将对象添加到 FabricJS topContext
Add objects to FabricJS topContext
尝试在 fabric.js
ctx 上绘制对象(以防止选择/z-index,并在 canvas 的顶部制作类似标尺的东西)但在 mouse:wheel
之后,我看到我绘制的对象有奇怪的堆叠效果。但是在 'selection' 事件中,ctx 清除并且工作正常。无法理解为什么 mouse:wheel
和 after:render
以及 fabric.js 中的其他事件如此奇怪,我该如何解决这个问题。谢谢!
已找到解决方案,在我的案例中,只需在 before:render
中添加 clearContext
方法
尝试在 fabric.js
ctx 上绘制对象(以防止选择/z-index,并在 canvas 的顶部制作类似标尺的东西)但在 mouse:wheel
之后,我看到我绘制的对象有奇怪的堆叠效果。但是在 'selection' 事件中,ctx 清除并且工作正常。无法理解为什么 mouse:wheel
和 after:render
以及 fabric.js 中的其他事件如此奇怪,我该如何解决这个问题。谢谢!
已找到解决方案,在我的案例中,只需在 before:render
中添加 clearContext
方法