summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/industry_gui.cpp2
-rw-r--r--src/waypoint_gui.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 962a59532..4e56b4055 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -927,6 +927,8 @@ public:
if (this->viewport != NULL) {
NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(IVW_VIEWPORT);
nvp->UpdateViewportCoordinates(this);
+
+ ScrollWindowToTile(Industry::Get(this->window_number)->location.GetCenterTile(), this, true); // Re-center viewport.
}
}
diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp
index c6e84d21b..b05172468 100644
--- a/src/waypoint_gui.cpp
+++ b/src/waypoint_gui.cpp
@@ -127,6 +127,8 @@ public:
NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(WAYPVW_VIEWPORT);
nvp->UpdateViewportCoordinates(this);
this->wp->UpdateVirtCoord();
+
+ ScrollWindowToTile(this->GetCenterTile(), this, true); // Re-center viewport.
}
}