diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index dd04fe9135..e1a0dd6be0 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -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 }; diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 8a74878262..b5946b43e9 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -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) {