1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-22 23:33:04 +01:00

Add a window method to resize spinners

This commit is contained in:
Michael Bernardi
2023-07-03 00:37:04 +02:00
parent a7881a5046
commit 1159c9d0bc
4 changed files with 26 additions and 12 deletions

View File

@@ -2148,3 +2148,23 @@ void WindowBase::ResizeFrameWithPage()
widgets[3].right = width - 1;
widgets[3].bottom = height - 1;
}
void WindowBase::ResizeSpinner(WidgetIndex widgetIndex, const ScreenCoordsXY& origin, const ScreenSize& size)
{
auto right = origin.x + size.width - 1;
auto bottom = origin.y + size.height - 1;
widgets[widgetIndex].left = origin.x;
widgets[widgetIndex].top = origin.y;
widgets[widgetIndex].right = right;
widgets[widgetIndex].bottom = bottom;
widgets[widgetIndex + 1].left = right - size.height;
widgets[widgetIndex + 1].top = origin.y + 1;
widgets[widgetIndex + 1].right = right - 1;
widgets[widgetIndex + 1].bottom = bottom - 1;
widgets[widgetIndex + 2].left = right - size.height * 2;
widgets[widgetIndex + 2].top = origin.y + 1;
widgets[widgetIndex + 2].right = right - size.height - 1;
widgets[widgetIndex + 2].bottom = bottom - 1;
}