drawingboard.js icon indicating copy to clipboard operation
drawingboard.js copied to clipboard

eraser on background image doesn't work

Open justinhunt opened this issue 10 years ago • 1 comments

The eraser does not work as expected when a background image is set. Even when the eraserColor is set to transparent, it erases the image with a color.

justinhunt avatar Nov 15 '13 05:11 justinhunt

Well, this is kinda tricky but, I just tested, this case seems to work "normally" for me.

Here is the thing: everything is drawn only on one canvas as for now (there is no "background layer"). So the current, not ideal but "normal" behavior is that the eraser will always erase the background too.

When you set "transparent" as the eraserColor, it will show the color of your website's background. On http://leimi.github.io/drawingboard.js, it would show the gray background. Yeah, I could have called the "transparent" mode more like "destroyyyyyy".

As for now, the eraser won't erase anything if the eraserColor is set to "background" and the background is not a color.

Having some sort of second canvas layer that would be merge into the other one when needed (to export image as png for example) would be a better way to deal with the background.

manuhabitela avatar Nov 28 '13 12:11 manuhabitela