0
如何lockscaleX
和lockscaleY
但允許uniscaling
Fabric.js中的對象?這裏是我的嘗試:如何`lockscaleX`和`lockscaleY`,但允許`uniscaling`在Fabric.js中的對象?
if (shape.scaleX != 1 && shape.scaleY != 1) {
shape.width = shape.scaleX * shape.width;
shape.height = shape.scaleY * shape.height;
shape.scaleX = 1;
shape.scaleY = 1;
} else {
shape.scaleX = 1;
shape.scaleY = 1;
}