Fix brush

This commit is contained in:
Andras Schmelczer 2023-05-01 13:40:39 +01:00
parent 780388d74b
commit 9c7b91000f
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
2 changed files with 7 additions and 3 deletions

View file

@ -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);
}

View file

@ -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
}