Преглед на файлове

Update renderElement.ts

zsviczian преди 2 години
родител
ревизия
e82918f1c8
променени са 1 файла, в които са добавени 4 реда и са изтрити 3 реда
  1. 4 3
      src/renderer/renderElement.ts

+ 4 - 3
src/renderer/renderElement.ts

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