fixed width of scrollable info text (by subtracting draw offset)
authorHolger Schemel <holger.schemel@virtion.de>
Wed, 16 Oct 2024 22:41:51 +0000 (00:41 +0200)
committerHolger Schemel <holger.schemel@virtion.de>
Wed, 16 Oct 2024 22:44:26 +0000 (00:44 +0200)
This correction currently only affects credits and program info text.

src/screens.c

index 2f990aa6b950482f18ad3f2d4131e6e0b55e7903..c0bd1a841cea1be3bf268774cf84ad4c20af7365 100644 (file)
@@ -4144,12 +4144,14 @@ static void DrawInfoScreen_GenericScreen(int screen_nr, int num_screens, int use
     int font_width = getFontWidth(font_text);
     int font_height = getFontHeight(font_text);
     int line_height = font_height + line_spacing;
+    int draw_xoffset = mSX - SX;
+    int draw_yoffset = mSY - SY;
 
-    tmi->x = SXSIZE / 2;
+    tmi->x = (SXSIZE - draw_xoffset) / 2;
     tmi->y = MENU_SCREEN_INFO_YSTART + getHeadlineSpacing();
-    tmi->chars = SXSIZE / font_width;
+    tmi->chars = (SXSIZE - draw_xoffset) / font_width;
     tmi->width = tmi->chars * font_width;
-    tmi->height = MENU_SCREEN_INFO_YBOTTOM - tmi->y - 10;
+    tmi->height = MENU_SCREEN_INFO_YBOTTOM - tmi->y - 10 - draw_yoffset;
     tmi->lines = tmi->height / line_height;
     tmi->align = ALIGN_CENTER;
     tmi->valign = VALIGN_TOP;