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:
@@ -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 };
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user