wesmiler пре 6 година
родитељ
комит
d12a976e05
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      public/static/weixin/js/photo.js

+ 2 - 2
public/static/weixin/js/photo.js

@@ -692,8 +692,8 @@ var app = new Vue({
             }
             var cdata = $("#cropImg").cropper('getCanvasData');
             if(cdata.width>cropWidth){
-                var rate = cropWidth/cdata.width;
-                $("#cropImg").cropper("zoom", rate);
+                var rate = (cdata.width-cropWidth)/cropWidth;
+                $("#cropImg").cropper("zoom", -rate);
             }
             console.log(cropWidth+'+'+cropHeight);
             console.log(iWidth+'+'+iHeight);