Skip to content

Commit

Permalink
Merge pull request #1209 from NicoPennec/fix/preview
Browse files Browse the repository at this point in the history
[preview] fix comparison mode and annotation layer
  • Loading branch information
NicoPennec authored Oct 5, 2023
2 parents 649b78d + aec1bbb commit 1323da9
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 126 deletions.
16 changes: 8 additions & 8 deletions src/components/mixins/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,22 +504,22 @@ export const annotationMixin = {
let path, text
let scaleMultiplierX = 1
let scaleMultiplierY = 1
if (annotation && annotation.width) {
scaleMultiplierX = this.fabricCanvas.width / annotation.width
scaleMultiplierY = this.fabricCanvas.width / annotation.width
if (annotation?.width) {
scaleMultiplierX = canvas.width / annotation.width
scaleMultiplierY = canvas.width / annotation.width
}
if (annotation && annotation.height) {
scaleMultiplierY = this.fabricCanvas.height / annotation.height
if (annotation?.height) {
scaleMultiplierY = canvas.height / annotation.height
}
const canvasWidth = obj.canvasWidth || annotation.width
const canvasHeight = obj.canvasHeight

if (canvasWidth) {
scaleMultiplierX = this.fabricCanvas.width / canvasWidth
scaleMultiplierY = this.fabricCanvas.width / canvasWidth
scaleMultiplierX = canvas.width / canvasWidth
scaleMultiplierY = canvas.width / canvasWidth
}
if (canvasHeight) {
scaleMultiplierY = this.fabricCanvas.height / canvasHeight
scaleMultiplierY = canvas.height / canvasHeight
}

const base = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/mixins/fullscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const fullScreenMixin = {

documentExitFullScreen() {
if (document.exitFullscreen) {
document.exitFullscreen()
return document.exitFullscreen()
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen()
} else if (document.webkitCancelFullScreen) {
Expand Down
1 change: 1 addition & 0 deletions src/components/previews/BrowsingBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,6 @@ export default {
.current-index {
cursor: pointer;
white-space: nowrap;
}
</style>
10 changes: 1 addition & 9 deletions src/components/previews/PictureViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,7 @@ export default {
},
onWindowResize() {
const now = new Date().getTime()
this.lastCall = this.lastCall || 0
if (now - this.lastCall > 600) {
this.lastCall = now
this.$nextTick(this.resetPicture)
setTimeout(() => {
this.resetPicture()
}, 400)
}
this.resetPicture()
},
// Configuration
Expand Down
Loading

0 comments on commit 1323da9

Please sign in to comment.