【发布时间】:2015-04-15 22:41:04
【问题描述】:
我正在使用 farbric.js 在应用程序中编辑图像。 图像应该能够调整大小、移动/拖动和旋转。 问题是当我旋转图像(通过单击按钮)时,它不会位于画布的中心。所以我必须使用 centerObject() 让它工作。 但是,在我这样做之后,图像就不能再拖动了。
这是处理旋转的函数(它在一个类中):
rotationset : function(angle, offsetX, offsetY){
// this.obj is the origin object
this.Obj.left = offsetX;
this.Obj.top = offsetY;
this.Obj.angle = angle;
this.Obj.center();//center the image
//this.canvas also initialized on load.
this.canvas.calcOffset();
this.canvas.renderAll();
}
那么,问题是什么?还有其他解决方法吗?
【问题讨论】:
标签: javascript jquery fabricjs