fix(): Zooming in the corner of an image makes it fly away ()

* fix(): Zooming in the corner of an image makes it fly away

* fix: keeping layers in the right place even when zoomed in
This commit is contained in:
Vitor Henckel 2023-03-21 21:15:02 -03:00 committed by GitHub
parent 0ce5060246
commit 2f04add2a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -322,7 +322,7 @@ export default {
rgba(125,125,125,.2) 8px
)`
) : ''}`,
transform: `scale(${this.zoomFactor}) translate(${this.imageTranslateX}px, ${this.imageTranslateY}px)`,
transform: `scale(${this.zoomFactor}) translate(${this.imageTranslateX / 2}px, ${this.imageTranslateY / 2}px)`,
transition: `${!this.pan && this.animateZoom ? 'transform 250ms ease-in' : 'initial'}`,
width: `${this.sizedImageWidth}px`,
height: `${this.sizedImageHeight}px`
@ -709,7 +709,7 @@ export default {
getVisibleLayerStyles(layer) {
return {
backgroundImage: `url(${layer.source})`,
transform: `scale(${this.zoomFactor}) translate(${this.imageTranslateX}px, ${this.imageTranslateY}px)`,
transform: `scale(${this.zoomFactor}) translate(${this.imageTranslateX / 2}px, ${this.imageTranslateY / 2}px)`,
transition: `${!this.pan && this.animateZoom ? 'transform 250ms ease-in' : 'initial'}`
};
},