From 4141580ac11dc527ae27c112d2aec0d12224c494 Mon Sep 17 00:00:00 2001 From: Pihkaal Date: Thu, 26 Feb 2026 20:01:09 +0100 Subject: [PATCH] fix(nds): use fillTextHCentered instead of fillTextCentered (caused alignment issues in different langs) --- app/components/Home/BottomScreen/Buttons.vue | 8 ++++---- app/components/Settings/BottomScreen/NumberInput.vue | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/components/Home/BottomScreen/Buttons.vue b/app/components/Home/BottomScreen/Buttons.vue index dd18eae..ae53441 100644 --- a/app/components/Home/BottomScreen/Buttons.vue +++ b/app/components/Home/BottomScreen/Buttons.vue @@ -87,11 +87,11 @@ onRender((ctx) => { // gallery ctx.font = "7px NDS7"; ctx.fillStyle = pressed.value === "gallery" ? "#2c2c2c" : "#282828"; - fillTextCentered( + fillTextHCentered( ctx, $t("home.photoGallery"), 132, - 78 + getButtonOffset("gallery"), + 85 + getButtonOffset("gallery"), 87, ); @@ -127,12 +127,12 @@ onRender((ctx) => { 140, ); } - ctx.textBaseline = "alphabetic"; + ctx.textBaseline = "top"; // gba thing ctx.font = "10px NDS10"; ctx.fillStyle = "#a2a2a2"; - fillTextCentered(ctx, $t("home.greeting"), 79, 135, 140); + fillTextHCentered(ctx, $t("home.greeting"), 79, 137, 140); }); diff --git a/app/components/Settings/BottomScreen/NumberInput.vue b/app/components/Settings/BottomScreen/NumberInput.vue index e96d6fb..fd6a654 100644 --- a/app/components/Settings/BottomScreen/NumberInput.vue +++ b/app/components/Settings/BottomScreen/NumberInput.vue @@ -201,13 +201,11 @@ onRender((ctx) => { ctx.font = "10px NDS10"; ctx.fillStyle = "#000000"; ctx.letterSpacing = "0px"; - fillTextCentered( + fillTextHCentered( ctx, props.title, props.x + 1, - // TODO: -10 is needed because fillTextCentered isn't using top baseline - // i will change that in the future (maybe) - Y + ARROW_IMAGE_HEIGHT * 2 + SQUARE_HEIGHT - 6, + Y + ARROW_IMAGE_HEIGHT * 2 + SQUARE_HEIGHT + 3, downImage.value.rect.width, ); }, 10);