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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -