# HG changeset patch # User frosch # Date 2009-08-01 11:55:49 # Node ID 7e7470a9c171b56b96541bb44702c76311774146 # Parent 5ce20fe668943dc4a50ff25d173df32d0f58ddfc (svn r17020) -Fix: Recenter viewport of waypoint-gui after moving the sign. diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp --- a/src/waypoint_cmd.cpp +++ b/src/waypoint_cmd.cpp @@ -34,6 +34,8 @@ void Waypoint::UpdateVirtCoord() 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 @@ CommandCost CmdBuildRailWaypoint(TileInd } 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);