Don't copy the widget, use reference

This commit is contained in:
ζeh Matt committed 2025-05-23 18:25:06 +03:00
1 parent 374f17bac9
commit 5749466e00
2 files changed
+6 -6

No files matched your search

@@ -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 };
+3 -3
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)
{