0

使用 Fabric.js 绘制交互式形状,除非我创建多个形状,否则我无法编辑形状。

一个清楚地显示问题的演示在这里http://jsfiddle.net/pingcrosby/brZ2N/

  Click the box tool and draw 3 boxes NOT overlapping and try selecting them.
  Click the arrow (selection) tool - now selecting the box does not work as expected.

    (once you click enough and it works..everything from then on works as expected)

    Now try a 3 boxes and select the bounding group
    Now suddenly selecting all works as expected.

绘制初始形状后是否需要重置内部事件系统?

4

1 回答 1

0

晚了 4 年,但我正在尝试使用 Fabric 并修复了 @PingCrosby 的小提琴。

shape.setCoords()在鼠标向上提交形状时调用了,这将设置object.oCoords,否则它会停留在小的初始矩形,而不是调整大小的矩形。 https://jsbin.com/rujete/edit?html,js,输出

这被列为Fabric 陷阱之一。
我也更新了 https://github.com/kangax/fabric.js/wiki/FAQ

于 2016-04-01T10:21:13.307 回答