fabricjs 1.6.3: why active object is always shown

2019-02-18 17:47发布

good demo of my problem: http://fabricjs.com/hovering If you select any item, it is displayed on top. In earlier versions (1.5.0 - 1.6.2) this problem does not exist. Sorry for bad English.

标签: fabricjs
2条回答
We Are One
2楼-- · 2019-02-18 18:15

I believe that is meant as a convenience for the user. Although the object moves to the front while selected, as soon as it is deselected, it falls back to its original z-order.

You can test this out at the hovering demo you linked. Superimpose two objects and determine which is front of the other then select and deselect the object in the back. When you hover over them, the order should still be observed to be the same.

查看更多
祖国的老花朵
3楼-- · 2019-02-18 18:29

If you dont want thie behaviour, you can set the preserveObjectStacking to true. Check the docs here: http://fabricjs.com/docs/fabric.Canvas.html

However, there is this one issue with background objects, so beware https://github.com/kangax/fabric.js/issues/3095

Hopefully, they'll push a fix soon otherwise your last resort would be going back to 1.6.2.

查看更多
登录 后发表回答