changeset 16313:a09e9e494674 draft

(svn r21021) -Add [FS#4171]: Center industry gui and waypoint gui after resize (partly by Krille).
author alberth <alberth@openttd.org>
date Sat, 23 Oct 2010 20:51:48 +0000
parents e19d6bb9ff88
children cc19d914028a
files src/industry_gui.cpp src/waypoint_gui.cpp
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -927,6 +927,8 @@
 		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.
 		}
 	}
 
--- a/src/waypoint_gui.cpp
+++ b/src/waypoint_gui.cpp
@@ -127,6 +127,8 @@
 			NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(WAYPVW_VIEWPORT);
 			nvp->UpdateViewportCoordinates(this);
 			this->wp->UpdateVirtCoord();
+
+			ScrollWindowToTile(this->GetCenterTile(), this, true); // Re-center viewport.
 		}
 	}