Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在KonvaJSsceneFunc()中为 any定义Shape将导致每次调用它draw(),
sceneFunc()
Shape
draw()
Shape.draw()
layer.draw()
stage.draw()
问题是:如何防止sceneFunc()清除上下文并将过去的绘图保留在之前的调用中?
您可以使用clearBeforeDraw属性:
clearBeforeDraw
var layer = new Konva.Layer({clearBeforeDraw: false});
来自文档:
如果您不想在每个图层绘制之前清除画布,请将此属性设置为 false。默认值是true。