gliffy / canvas2svg

Translates HTML5 Canvas draw commands to SVG
MIT License
682 stars 154 forks source link

clearRect is drawing white instead of clearing to transparent #70

Open kaldrenon opened 5 years ago

kaldrenon commented 5 years ago

A clear HTML5 canvas should have nothing on it. In my usage, calling ```ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight)


and then drawing new stuff on the canvas still results in a #FFF rect being put in the resulting SVG. Is there a way to clear the canvas that's to spec with HTML5 canvas?
kaiservilhelm commented 4 years ago

I too have experienced this problem.

kaiservilhelm commented 4 years ago

kaldrenon, using ctx._clearCanvas() should work! mind you thats 2 ""s

JoeyPriceless commented 2 years ago

Yup, this is definitely unexpected behavior.

The Mozilla docs state that clearRect should set the pixels in the area to transparent back.

Why set to white when clearCanvas exists?