changeset 12580:9dee692bdf1a draft

(svn r17020) -Fix: Recenter viewport of waypoint-gui after moving the sign.
author frosch <frosch@openttd.org>
date Sat, 01 Aug 2009 11:55:49 +0000
parents 1821acd132ca
children 374037971842
files src/waypoint_cmd.cpp
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/waypoint_cmd.cpp
+++ b/src/waypoint_cmd.cpp
@@ -34,6 +34,8 @@
 	Point pt = RemapCoords2(TileX(this->xy) * TILE_SIZE, TileY(this->xy) * TILE_SIZE);
 	SetDParam(0, this->index);
 	this->sign.UpdatePosition(pt.x, pt.y - 0x20, STR_WAYPOINT_VIEWPORT);
+	/* Recenter viewport */
+	InvalidateWindowData(WC_WAYPOINT_VIEW, this->index);
 }
 
 /**
@@ -270,7 +272,6 @@
 		} else if (!wp->IsInUse()) {
 			/* Move existing (recently deleted) waypoint to the new location */
 			wp->xy = start_tile;
-			InvalidateWindowData(WC_WAYPOINT_VIEW, wp->index);
 		}
 		wp->owner = GetTileOwner(start_tile);