Let checkbox widgets respect widget width for their labels

This commit is contained in:
Aaron van Geffen committed 2025-04-11 16:22:08 +02:00
1 parent 88407ff5df
commit 2de3e96dfb
2 files changed
+11 -2

No files matched your search

+1
View File
@@ -7,6 +7,7 @@
- Fix: [#21919] Non-recolourable cars still show colour picker.
- Fix: [#23108] Missing pieces on Hypercoaster and Hyper-Twister, even with the ‘all drawable track pieces’ cheat enabled.
- Fix: [#24013] Failure to load a scenario preview image (minimap) could lead to an uncaught exception error message.
- Fix: [#24121] Checkbox labels run beyond the edge of the window if they’re too long to fit.
- Fix: [#24142] [Plugin] Track origin is miscalculated on downward slopes.
- Fix: [#24220] Narrow station platforms have missing sides on certain rotations.
+10 -2
View File
@@ -653,8 +653,16 @@ namespace OpenRCT2::Ui
if (widget.text == kStringIdNone)
return;
auto [stringId, formatArgs] = WidgetGetStringidAndArgs(widget);
GfxDrawStringLeftCentred(dpi, stringId, formatArgs, colour, { midLeft + ScreenCoordsXY{ 14, 0 } });
auto stringId = widget.text;
auto ft = Formatter::Common();
if (widget.flags & WIDGET_FLAGS::TEXT_IS_STRING)
{
stringId = STR_STRING;
ft.Add<utf8*>(widget.string);
}
DrawTextEllipsised(
dpi, w.windowPos + ScreenCoordsXY{ widget.left + 14, widget.textTop() }, widget.width() - 14, stringId, ft, colour);
}
/**