1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-01 10:59:12 +00:00

Change: [UI] Use proper matrix padding for server list test.

Text was only positioned correctly at 1x scale due to old pixel-based positioning method.
This commit is contained in:
2024-07-21 09:22:02 +01:00
parent 5571d3f53d
commit d850e88c55

View File

@@ -361,8 +361,8 @@ protected:
GfxFillRect(r.Shrink(WidgetDimensions::scaled.bevel), PC_GREY);
}
/* offsets to vertically centre text and icons */
int text_y_offset = (this->resize.step_height - GetCharacterHeight(FS_NORMAL)) / 2 + 1;
/* Offset to vertically position text. */
int text_y_offset = WidgetDimensions::scaled.matrix.top + (this->resize.step_height - WidgetDimensions::scaled.matrix.Vertical() - GetCharacterHeight(FS_NORMAL)) / 2;
info = info.Shrink(WidgetDimensions::scaled.framerect);
name = name.Shrink(WidgetDimensions::scaled.framerect);