muaz-khan / Canvas-Designer

Collaborative, extendable, JavaScript Canvas2D drawing tool, supports dozens of builtin tools, as well as generates JavaScript code for 2D animations.
https://www.webrtc-experiment.com/Canvas-Designer/
MIT License
368 stars 171 forks source link

How to get clear canvas drawing image.. #19

Open Prajaktatk opened 7 years ago

Prajaktatk commented 7 years ago

hello sir, In Firefox when i draw image and erase some part and then click on export as image button then in image, erase part also get displays but in chrome erase part not display. how to get rid from this?

RamyaAshika commented 5 years ago

Did you find any solution for this? @Prajaktatk @muaz-khan

RamyaAshika commented 5 years ago

Ya, I found it. Just make this point as empty.

function decorateClear() { var context = getContext("clear") , image = new Image; image.onload = function () { context.drawImage(image, 4, 4, 32, 32), document.querySelector("#clear").onclick = function () { // points.length && (points.length = points.length - 1, drawHelper.redraw()), syncPoints(!0) points = [], drawHelper.redraw() } }, image.src = data_uris.clear }