fixe button offset

This commit is contained in:
Didictateur 2025-04-13 15:00:02 +02:00
parent eb93dec6ba
commit 94a619b1f0
2 changed files with 2 additions and 2 deletions

File diff suppressed because one or more lines are too long

View file

@ -265,7 +265,7 @@ function renderButton(
ctx.font = "30px garamond"; ctx.font = "30px garamond";
// Center text based on its length // Center text based on its length
const textXPosition = x + BUTTON_WIDTH * (0.5 - config.text.length * 0.025); const textXPosition = x + BUTTON_WIDTH * (0.25 - config.text.length * 0.025);
const textYPosition = y + BUTTON_HEIGHT/2 * 1.3; const textYPosition = y + BUTTON_HEIGHT/2 * 1.3;
ctx.fillText(config.text, textXPosition, textYPosition); ctx.fillText(config.text, textXPosition, textYPosition);