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

Don't copy the widget, use reference

This commit is contained in:
ζeh Matt
2025-05-23 18:22:40 +03:00
parent 374f17bac9
commit 5749466e00
2 changed files with 6 additions and 6 deletions

View File

@@ -612,9 +612,9 @@ namespace OpenRCT2::Ui::Windows
void OnDraw(RenderTarget& rt) override
{
auto leftWidget = widgets[WIDX_LEFT_OUTSET];
auto rightWidget = widgets[WIDX_RIGHT_OUTSET];
auto middleWidget = widgets[WIDX_MIDDLE_OUTSET];
const auto& leftWidget = widgets[WIDX_LEFT_OUTSET];
const auto& rightWidget = widgets[WIDX_RIGHT_OUTSET];
const auto& middleWidget = widgets[WIDX_MIDDLE_OUTSET];
// Draw panel grey backgrounds
auto leftTop = windowPos + ScreenCoordsXY{ leftWidget.left, leftWidget.top };

View File

@@ -619,9 +619,9 @@ namespace OpenRCT2::Ui::Windows
if (viewport != nullptr)
{
auto widget = widgets[WIDX_VIEWPORT];
auto reqViewportWidth = widget.width() - 1;
auto reqViewportHeight = widget.height() - 1;
const auto& widget = widgets[WIDX_VIEWPORT];
const auto reqViewportWidth = widget.width() - 1;
const auto reqViewportHeight = widget.height() - 1;
viewport->pos = windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 1 };
if (viewport->width != reqViewportWidth || viewport->height != reqViewportHeight)
{