Changeset - r22536:73c92403b703
[Not reviewed]
master
0 1 0
frosch - 8 years ago 2017-02-05 17:54:46
frosch@openttd.org
(svn r27743) -Fix [FS#6537]: Extra viewports did not center on the selected tile. (hackalittlebit)
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/viewport_gui.cpp
Show inline comments
 
@@ -68,13 +68,13 @@ public:
 
			const Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
 

	
 
			/* center on same place as main window (zoom is maximum, no adjustment needed) */
 
			pt.x = w->viewport->scrollpos_x + w->viewport->virtual_width / 2;
 
			pt.y = w->viewport->scrollpos_y + w->viewport->virtual_height / 2;
 
		} else {
 
			pt = RemapCoords(TileX(tile) * TILE_SIZE + TILE_SIZE / 2, TileY(tile) * TILE_SIZE + TILE_SIZE / 2, TileHeight(tile));
 
			pt = RemapCoords(TileX(tile) * TILE_SIZE + TILE_SIZE / 2, TileY(tile) * TILE_SIZE + TILE_SIZE / 2, TilePixelHeight(tile));
 
		}
 

	
 
		this->viewport->scrollpos_x = pt.x - this->viewport->virtual_width / 2;
 
		this->viewport->scrollpos_y = pt.y - this->viewport->virtual_height / 2;
 
		this->viewport->dest_scrollpos_x = this->viewport->scrollpos_x;
 
		this->viewport->dest_scrollpos_y = this->viewport->scrollpos_y;
0 comments (0 inline, 0 general)