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

Merge pull request #20545 from mrmbernardi/resize_spinners

Add a window method to resize spinners
This commit is contained in:
Matthias Moninger
2023-08-19 00:24:08 +03:00
committed by GitHub
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;
}