旋转画布后的图像被裁剪。如何将图像调整为画布大小?
$("#rotate").click(function(){
var curAngle = canvas.item(0).getAngle();
if(curAngle == 360)
curAngle = 0
if(curAngle == 0 || curAngle == 180){
canvas.setHeight(200);
canvas.setWidth(400);
}
if(curAngle == 90 || curAngle == 270){
canvas.setHeight(400);
canvas.setWidth(200);
}
canvas.item(0).setAngle(curAngle+90);
canvas.renderAll();
});