Skip to content
Permalink
Browse files

fix ratio

修改ratio的计算方式,ratio比例算的时候会差一些,比如我原始比例2316 × 3088按照原来比例会得出2316X3300,造成图片变成
  • Loading branch information...
Xiaohantx committed Jul 11, 2019
1 parent 39e33d1 commit 77ac4af6b65a10e16e3cf12f631661780196ab11
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/processImg.js
@@ -195,7 +195,7 @@
var width = img.width;

if(width>imgWH || height>imgWH){
var ratio = ~~(height/width*10)/10;
var ratio = (height / width).toFixed(3);
if(width>height){
width = imgWH;
height = imgWH*ratio;

0 comments on commit 77ac4af

Please sign in to comment.
You can’t perform that action at this time.