fabricjs交互式绘图我是否需要在绘制第一个形状后重置事件系统?

时间:2012-04-17 16:53:47

标签: fabricjs

使用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.

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

1 个答案:

答案 0 :(得分:0)

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

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

这被列为Fabric gotchas之一 我还更新了https://github.com/kangax/fabric.js/wiki/FAQ