diff --git a/src/game-loop/game-loop.ts b/src/game-loop/game-loop.ts index 8763c1e..543786e 100644 --- a/src/game-loop/game-loop.ts +++ b/src/game-loop/game-loop.ts @@ -150,6 +150,10 @@ export default class GameLoop { this.device.queue.submit([commandEncoder.finish()]); + if (!this.isSwipeActive) { + this.brushPipeline.clearSwipes(); + } + if (settings.simulatedDelayMs > 0) { await sleep(settings.simulatedDelayMs); } diff --git a/src/pipelines/brush/brush-pipeline.ts b/src/pipelines/brush/brush-pipeline.ts index 9af60ab..8828bf0 100644 --- a/src/pipelines/brush/brush-pipeline.ts +++ b/src/pipelines/brush/brush-pipeline.ts @@ -126,12 +126,12 @@ export class BrushPipeline { new Float32Array([brushWidth / 2, brushWidthRandomness]) ); - if (this.linePoints.length === 0) { + this.actualPoints = this.linePoints.slice(); + + if (this.actualPoints.length === 0) { return; } - this.actualPoints = this.linePoints.slice(); - if (this.linePoints.length === 1) { this.actualPoints.push(this.linePoints[0]); // allow single point swipes }