Roo/bootstrap/UploadCropbox.js
authoredward <edward@roojs.com>
Mon, 22 Feb 2016 05:12:53 +0000 (13:12 +0800)
committeredward <edward@roojs.com>
Mon, 22 Feb 2016 05:12:53 +0000 (13:12 +0800)
Roo/bootstrap/UploadCropbox.js

index a144344..70cef98 100644 (file)
@@ -759,6 +759,8 @@ Roo.extend(Roo.bootstrap.UploadCropbox, Roo.bootstrap.Component,  {
         
         this.startDistance = Math.sqrt(x + y);
         
+        this.startScale = this.scale;
+        
         this.pinching = true;
         this.dragable = false;
         
@@ -792,7 +794,7 @@ Roo.extend(Roo.bootstrap.UploadCropbox, Roo.bootstrap.Component,  {
         
         this.endDistance = Math.sqrt(x + y);
         
-        var scale = this.startScale + Math.floor(Math.log(this.endDistance / this.startDistance) / Math.log(1.1));
+        this.scale = this.startScale + Math.floor(Math.log(this.endDistance / this.startDistance) / Math.log(1.1));
         
         var width = Math.ceil(this.imageEl.OriginWidth * this.baseScale * Math.pow(1.1, scale));
         var height = Math.ceil(this.imageEl.OriginHeight * this.baseScale * Math.pow(1.1, scale));