javascript - How to clean part of layer with KineticJS? -


i'm working on drawing tool kineticjs. there problem. can't clean part of layer. algorithm of drawing: draw line, use rubber cleaning , continue drawing. , clean parts of layer disappearing. full, before using rubber.

demo

code: erase

code: draw

layer.clear(x,y,width,height) clear canvas using context.clearrect(x,y,width,height).

but remember kinetic objects retained objects on canvas automatically redrawn.

that's why canvas fills again after layer.clear.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -