Changeset - r12570:7e7470a9c171
[Not reviewed]
master
0 1 0
frosch - 15 years ago 2009-08-01 11:55:49
frosch@openttd.org
(svn r17020) -Fix: Recenter viewport of waypoint-gui after moving the sign.
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/waypoint_cmd.cpp
Show inline comments
 
@@ -31,12 +31,14 @@
 
 */
 
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);
 
}
 

	
 
/**
 
 * Set the default name for a waypoint
 
 * @param wp Waypoint to work on
 
 */
 
@@ -267,13 +269,12 @@ CommandCost CmdBuildRailWaypoint(TileInd
 
	if (flags & DC_EXEC) {
 
		if (wp == NULL) {
 
			wp = new Waypoint(start_tile);
 
		} 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);
 

	
 
		wp->rect.BeforeAddRect(start_tile, width, height, StationRect::ADD_TRY);
 

	
 
		wp->delete_ctr = 0;
0 comments (0 inline, 0 general)