1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Let checkbox widgets respect widget width for their labels

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

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 theyre 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.

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);
}
/**