In KonvaJS defining sceneFunc()
for any Shape
will result in calling it each time draw()
is called,
Shape.draw()
layer.draw()
stage.draw()
The question is: How to prevent sceneFunc()
from clearing the context and persist the past drawings on the previous call of it?
You can use clearBeforeDraw
property:
var layer = new Konva.Layer({clearBeforeDraw: false});
From docs:
set this property to false if you don't want to clear the canvas before each layer draw. The default value is true.