From c48ddee5c45b5bbb880f625c3cbe8c492ab150c9 Mon Sep 17 00:00:00 2001 From: MeirGavish Date: Wed, 23 Jul 2025 00:32:31 +0300 Subject: [PATCH] Fixed a bug in text overflow case for update_text_rect_to_right_align_num() --- source/graphic_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/graphic_utils.c b/source/graphic_utils.c index aa7f45b..5311711 100644 --- a/source/graphic_utils.c +++ b/source/graphic_utils.c @@ -155,11 +155,11 @@ void tte_erase_rect_wrapper(Rect rect) void update_text_rect_to_right_align_num(Rect* rect, int num, int overflow_direction) { int num_digits = get_digits(num); - if (overflow_direction == OVERFLOW_RIGHT) + if (overflow_direction == OVERFLOW_LEFT) { rect->left = max(0, rect->right - num_digits * TILE_SIZE); } - else if (overflow_direction == OVERFLOW_LEFT) + else if (overflow_direction == OVERFLOW_RIGHT) { int num_fitting_digits = rect_width(rect) / TILE_SIZE; if (num_digits < num_fitting_digits)