From da15ff429d9fffd716f2a16b4f42493e15bdd277 Mon Sep 17 00:00:00 2001 From: Miguel Ripoll <3296866+MiguelRipoll23@users.noreply.github.com> Date: Sun, 22 Dec 2024 16:59:36 +0100 Subject: [PATCH] Increase width of time box and adjust text positioning in scoreboard rendering (#70) --- src/objects/scoreboard-object.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/objects/scoreboard-object.ts b/src/objects/scoreboard-object.ts index 7978d74..2c2b194 100644 --- a/src/objects/scoreboard-object.ts +++ b/src/objects/scoreboard-object.ts @@ -13,7 +13,7 @@ export class ScoreboardObject { private readonly SQUARE_SIZE: number = 50; private readonly SPACE_BETWEEN: number = 10; - private readonly TIME_BOX_WIDTH: number = 120; + private readonly TIME_BOX_WIDTH: number = 150; // Increased width from 120 to 150 private readonly TIME_BOX_HEIGHT: number = 50; private readonly CORNER_RADIUS: number = 10; @@ -179,7 +179,7 @@ export class ScoreboardObject context, score.toString(), x + this.SQUARE_SIZE / 2, - this.y + 12 + this.SQUARE_SIZE / 2 + this.y + 12.5 + this.SQUARE_SIZE / 2 ); } @@ -194,7 +194,7 @@ export class ScoreboardObject context.fillStyle = this.TIME_BOX_FILL_COLOR; this.roundedRect(context, x, y, width, height, this.CORNER_RADIUS); context.fill(); - this.renderText(context, text, x + width / 2, y + 12 + height / 2); + this.renderText(context, text, x + width / 2, y + 12.5 + height / 2); } private roundedRect(