From 14418c8d64aa9e8eb7312d20783f8484b78e4e61 Mon Sep 17 00:00:00 2001 From: lilit_simonyan Date: Wed, 22 Apr 2020 12:16:47 +0400 Subject: [PATCH] Fix cropper issue --- package.json | 2 +- src/assets/js/crop.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 86c1f47..d169677 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-image-markup", - "version": "3.0.13", + "version": "3.0.14", "description": "vue-image-markup will provide you to edit uploaded image easily and save it.", "main": "src/Editor.vue", "repository": { diff --git a/src/assets/js/crop.js b/src/assets/js/crop.js index 571f105..d85a8ed 100644 --- a/src/assets/js/crop.js +++ b/src/assets/js/crop.js @@ -88,8 +88,8 @@ export default (function () { inst.canvas.add(rect); fabric.Image.fromURL(src, function (oImg1) { rectRed = new fabric.Rect({ - left: (oImg1.width - properties.width) / 2, - top: (oImg1.height - properties.height) / 2, + left: (oImg1.width - cropperWidth) / 2, + top: (oImg1.height - cropperHeight) / 2, width: cropperWidth, height: cropperHeight, fill: '', @@ -104,7 +104,7 @@ export default (function () { hasRotatingPoint: properties.hasRotatingPoint, lockUniScaling: JSON.parse(properties.lockUniScaling), noScaleCache: JSON.parse(properties.noScaleCache), - strokeUniform: JSON.parse(properties.strokeUniform), + strokeUniform: JSON.parse( properties.strokeUniform), clipTo: function (context) { context.translate(-this.width / 2, -this.height / 2); for (let x = 0; x <= this.width; x += this.width / 3) {