Preserve ratio on zoom.
authorAlexandre Segura <mex.zktk@gmail.com>
Tue, 14 Mar 2017 17:40:02 +0100
changeset 434 924d95c07149
parent 433 616fc1fad25f
child 435 26338fe87deb
Preserve ratio on zoom.
src_js/iconolab-bundle/src/components/editor/Canvas.vue
--- a/src_js/iconolab-bundle/src/components/editor/Canvas.vue	Tue Mar 14 17:02:43 2017 +0100
+++ b/src_js/iconolab-bundle/src/components/editor/Canvas.vue	Tue Mar 14 17:40:02 2017 +0100
@@ -234,8 +234,8 @@
                 } else {
                     var center = this.getCenter();
 
-                    var viewBoxW = this.imgMinSize - (this.imgMinSize * factor);
-                    var viewBoxH = viewBoxW;
+                    var viewBoxW = this.imageWidth - (this.imageWidth * factor);
+                    var viewBoxH = this.imageHeight - (this.imageHeight * factor);
 
                     var viewBox = [
                         center.x - viewBoxW / 2,