(svn r14143) -Codechange: Recenter viewport of waypoint window when relocating the waypoint.
authorfrosch
Sat, 23 Aug 2008 16:34:05 +0000
changeset 9986 4ee5b226abad
parent 9985 9f3177737d88
child 9987 ee1e22594629
(svn r14143) -Codechange: Recenter viewport of waypoint window when relocating the waypoint.
src/waypoint.cpp
src/waypoint_gui.cpp
--- a/src/waypoint.cpp	Sat Aug 23 16:26:01 2008 +0000
+++ b/src/waypoint.cpp	Sat Aug 23 16:34:05 2008 +0000
@@ -249,6 +249,7 @@
 
 			RedrawWaypointSign(wp);
 			wp->xy = tile;
+			InvalidateWindowData(WC_WAYPOINT_VIEW, wp->index);
 		}
 
 		const StationSpec* statspec;
--- a/src/waypoint_gui.cpp	Sat Aug 23 16:26:01 2008 +0000
+++ b/src/waypoint_gui.cpp	Sat Aug 23 16:34:05 2008 +0000
@@ -77,6 +77,13 @@
 		}
 	}
 
+	virtual void OnInvalidateData(int data)
+	{
+		int x = TileX(this->wp->xy) * TILE_SIZE;
+		int y = TileY(this->wp->xy) * TILE_SIZE;
+		ScrollWindowTo(x,y, this);
+	}
+
 	virtual void OnQueryTextFinished(char *str)
 	{
 		if (!StrEmpty(str)) {