From fb4b9beb7d39688fba6f3d6cacc55df1f15b5fa4 Mon Sep 17 00:00:00 2001 From: "Petr Mifek (EDM)" Date: Tue, 5 Nov 2019 21:40:37 +0100 Subject: [PATCH] A basic remedy to issues reported as #167 and #191 --- src/cropper.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cropper.vue b/src/cropper.vue index e81633f..e44a54c 100644 --- a/src/cropper.vue +++ b/src/cropper.vue @@ -377,6 +377,16 @@ export default { x = 1 - speed } + // when a new image is loaded with the same aspect ratio + // as the previously remove()d one, the imgData.width and .height + // effectivelly don't change (they change through one tick + // and end up being the same as before the tick, so the + // watchers don't trigger), make sure scaleRatio isn't null so + // that zooming works... + if (this.scaleRatio === null) { + this.scaleRatio = this.imgData.width / this.naturalWidth + } + this.scaleRatio *= x },