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:
Peter Nelson 2024-07-21 09:22:02 +01:00 committed by Peter Nelson
parent d85f4b3ebf
commit ba2b14b075

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);