Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
igwen6w committed Jan 10, 2023
1 parent e366777 commit e2177d3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Crop.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,46 +186,63 @@ function cropper(imgSrc,cropperFileE)
},
// 设置比例
btn4:function(){
return false;
},
// 比例 3:2
btn5:function(){
cropper.destroy();
options['aspectRatio'] = 1.5;
cropper = new Cropper(image, options);
return false;
},
// 16:9
btn6:function(){
cropper.destroy();
options['aspectRatio'] = 1.77777777;
cropper = new Cropper(image, options);
return false;
},
// 2:1
btn7:function(){
cropper.destroy();
options['aspectRatio'] = 2;
cropper = new Cropper(image, options);
return false;
},
// 15:7
btn8:function(){
cropper.destroy();
options['aspectRatio'] = 2.142857;
cropper = new Cropper(image, options);
return false;
},
// 16:5
btn9:function(){
cropper.destroy();
options['aspectRatio'] = 3.2;
cropper = new Cropper(image, options);
return false;
},
// 4:3
btn10:function(){
cropper.destroy();
options['aspectRatio'] = 1.333333;
cropper = new Cropper(image, options);
return false;
},
// 1:1
btn11:function(){
cropper.destroy();
options['aspectRatio'] = 1;
cropper = new Cropper(image, options);
return false;
},
// free
btn12:function(){
cropper.destroy();
options['aspectRatio'] = NaN;
cropper = new Cropper(image, options);
return false;
}
});
var image = document.getElementById('cropping-img');
Expand Down

0 comments on commit e2177d3

Please sign in to comment.