mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r20813) -Fix: make the waypoint viewport keep centered around the waypoint when resizing the window (Krille)
This commit is contained in:
parent
15212cf948
commit
7a88433228
|
@ -110,7 +110,7 @@ public:
|
||||||
|
|
||||||
int x = TileX(this->wp->xy) * TILE_SIZE;
|
int x = TileX(this->wp->xy) * TILE_SIZE;
|
||||||
int y = TileY(this->wp->xy) * TILE_SIZE;
|
int y = TileY(this->wp->xy) * TILE_SIZE;
|
||||||
ScrollWindowTo(x, y, -1, this);
|
ScrollWindowTo(x, y, -1, this, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnResize()
|
virtual void OnResize()
|
||||||
|
@ -118,6 +118,7 @@ public:
|
||||||
if (this->viewport != NULL) {
|
if (this->viewport != NULL) {
|
||||||
NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(WAYPVW_VIEWPORT);
|
NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(WAYPVW_VIEWPORT);
|
||||||
nvp->UpdateViewportCoordinates(this);
|
nvp->UpdateViewportCoordinates(this);
|
||||||
|
this->wp->UpdateVirtCoord();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue