mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
Align Staff viewport resizing with the Guest window (#25072)
This commit is contained in:
committed by
GitHub
parent
330b54e4a4
commit
f62b74c732
@@ -538,14 +538,6 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
widgets[WIDX_FIRE].left = width - 25;
|
||||
widgets[WIDX_FIRE].right = width - 2;
|
||||
|
||||
if (viewport != nullptr)
|
||||
{
|
||||
const Widget& viewportWidget = widgets[WIDX_VIEWPORT];
|
||||
viewport->pos = windowPos + ScreenCoordsXY{ viewportWidget.left + 1, viewportWidget.top + 1 };
|
||||
viewport->width = widgets[WIDX_VIEWPORT].width() - 1;
|
||||
viewport->height = widgets[WIDX_VIEWPORT].height() - 1;
|
||||
}
|
||||
}
|
||||
|
||||
void OverviewDraw(RenderTarget& rt)
|
||||
@@ -620,6 +612,20 @@ namespace OpenRCT2::Ui::Windows
|
||||
{
|
||||
WindowSetResize(*this, kWindowSize, { 500, 450 });
|
||||
|
||||
if (viewport != nullptr)
|
||||
{
|
||||
const Widget& viewportWidget = widgets[WIDX_VIEWPORT];
|
||||
const auto reqViewportWidth = viewportWidget.width() - 1;
|
||||
const auto reqViewportHeight = viewportWidget.height() - 1;
|
||||
|
||||
viewport->pos = windowPos + ScreenCoordsXY{ viewportWidget.left + 1, viewportWidget.top + 1 };
|
||||
if (viewport->width != reqViewportWidth || viewport->height != reqViewportHeight)
|
||||
{
|
||||
viewport->width = reqViewportWidth;
|
||||
viewport->height = reqViewportHeight;
|
||||
}
|
||||
}
|
||||
|
||||
ViewportInit();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user