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);