我正在使用fabricjs作为图形应用程序。UI从服务器端加载几个图像。服务器端加载一个位图,然后对其进行旋转,并将旋转后的图像发送给fabricjs。
我想要做的是找出用户是否像服务器旋转之前那样旋转了图像。服务器旋转角度是已知的。
我想知道是否有人知道fabricjs中的角度是如何计算的,或者是否有人可以提出一个解决这个问题的方法。
提前谢谢。
发布于 2014-02-26 14:41:10
您可以很容易地通过getAngle()方法获得它。
selectedObject = canvas.getActiveObject();
selectedObject.getAngle();发布于 2014-03-19 22:28:21
您可以添加更多的json文件来获得这样的所有线缆
topLeftCornerX: toFixed(this.oCoords.tl.x, NUM_FRACTION_DIGITS),
topLeftCornerY: toFixed(this.oCoords.tl.y, NUM_FRACTION_DIGITS),
topRightCornerX: toFixed(this.oCoords.tr.x, NUM_FRACTION_DIGITS),
topRightCornerY: toFixed(this.oCoords.tr.y, NUM_FRACTION_DIGITS),
bottomLeftCornerX: toFixed(this.oCoords.bl.x, NUM_FRACTION_DIGITS),
bottomLeftCornerY: toFixed(this.oCoords.bl.y, NUM_FRACTION_DIGITS),
bottomRightCornerX: toFixed(this.oCoords.br.x, NUM_FRACTION_DIGITS),
bottomRightCornerY: toFixed(this.oCoords.br.y, NUM_FRACTION_DIGITS),读一读你会有更多的点来获得合适的角度。希望这对你有用
https://stackoverflow.com/questions/21656690
复制相似问题