1st working swept

This commit is contained in:
Schluffe
2026-03-22 17:49:12 +01:00
parent f5fc9224b9
commit f65951830d
5 changed files with 101 additions and 33 deletions
+6 -11
View File
@@ -38,10 +38,10 @@ export function strokeRect(
ctx.globalAlpha = alpha;
ctx.lineWidth = lineWidth;
ctx.strokeRect(
rect.position.x - 0.5,
rect.position.y - 0.5,
rect.width,
rect.height,
rect.position.x + 0.5,
rect.position.y + 0.5,
rect.width - 1,
rect.height - 1,
);
ctx.restore();
}
@@ -53,13 +53,8 @@ export function fillRect(
alpha: number = 1.0,
): void {
ctx.save();
ctx.strokeStyle = color;
ctx.fillStyle = color;
ctx.globalAlpha = alpha;
ctx.fillRect(
rect.position.x - 0.5,
rect.position.y - 0.5,
rect.width,
rect.height,
);
ctx.fillRect(rect.position.x, rect.position.y, rect.width, rect.height);
ctx.restore();
}