From df7a32d36449c5d14e0bb3efa99379b460057305 Mon Sep 17 00:00:00 2001 From: alberth Date: Sat, 23 Oct 2010 20:51:48 +0000 Subject: [PATCH] (svn r21021) -Add [FS#4171]: Center industry gui and waypoint gui after resize (partly by Krille). --- src/industry_gui.cpp | 2 ++ src/waypoint_gui.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 962a595326..4e56b4055a 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -927,6 +927,8 @@ public: if (this->viewport != NULL) { NWidgetViewport *nvp = this->GetWidget(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 c6e84d21bc..b05172468e 100644 --- a/src/waypoint_gui.cpp +++ b/src/waypoint_gui.cpp @@ -127,6 +127,8 @@ public: NWidgetViewport *nvp = this->GetWidget(WAYPVW_VIEWPORT); nvp->UpdateViewportCoordinates(this); this->wp->UpdateVirtCoord(); + + ScrollWindowToTile(this->GetCenterTile(), this, true); // Re-center viewport. } }