Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

eraser on background image doesn't work #20

Open
justinhunt opened this issue Nov 15, 2013 · 1 comment
Open

eraser on background image doesn't work #20

justinhunt opened this issue Nov 15, 2013 · 1 comment

Comments

@justinhunt
Copy link

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.

@manuhabitela
Copy link
Owner

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants