diff --git a/libs/webgl/src/engine/BaseDrawingEngine.ts b/libs/webgl/src/engine/BaseDrawingEngine.ts index 2ee31dd..c07aa81 100644 --- a/libs/webgl/src/engine/BaseDrawingEngine.ts +++ b/libs/webgl/src/engine/BaseDrawingEngine.ts @@ -9,7 +9,7 @@ export abstract class BaseDrawingEngine< private programs: Programs constructor(canvas: HTMLCanvasElement, programs: (gl: WebGLRenderingContext) => Programs) { - const gl = canvas.getContext("webgl") + const gl = canvas.getContext("webgl", { preserveDrawingBuffer: true }) if (!gl) { throw new Error("WebGL not supported") } diff --git a/libs/webgl/src/engine/DrawingEngine.ts b/libs/webgl/src/engine/DrawingEngine.ts index 95d9a5c..c65e85a 100644 --- a/libs/webgl/src/engine/DrawingEngine.ts +++ b/libs/webgl/src/engine/DrawingEngine.ts @@ -29,9 +29,6 @@ export class DrawingEngine extends BaseDrawingEngine { } public updateDrawing() { - for (const { path, color } of this.context.pathHistory) { - this.drawLine(path, { drawType: DrawType.STATIC_DRAW, color }) - } if (this.context.currentPath.points.length > 0) { this.drawLine(this.context.currentPath.points, { drawType: DrawType.DYNAMIC_DRAW }) }