remove contex.save and restore

This commit is contained in:
zsviczian 2022-11-20 20:37:51 +01:00 committed by GitHub
parent 3fb1a870e6
commit 12c1d6cd09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -217,20 +217,20 @@ const drawElementOnCanvas = (
} }
case "freedraw": { case "freedraw": {
// Draw directly to canvas // Draw directly to canvas
context.save(); //context.save();
context.fillStyle = element.strokeColor; context.fillStyle = element.strokeColor;
const path = getFreeDrawPath2D(element) as Path2D; const path = getFreeDrawPath2D(element) as Path2D;
const fillShape = getShapeForElement(element); const fillShape = getShapeForElement(element);
if (fillShape && path) { if (fillShape) {
rc.draw(fillShape); rc.draw(fillShape);
} }
context.fillStyle = element.strokeColor; context.fillStyle = element.strokeColor;
//context.fill(path); context.fill(path);
context.restore(); //context.restore();
break; break;
} }
case "image": { case "image": {