Change: Use CenterBounds function in more places.

CenterBounds may have a 1 pixel difference so the result is not exactly
the same.
This commit is contained in:
Peter Nelson
2022-09-07 08:31:02 +01:00
committed by PeterN
parent 18201dfbc3
commit eb4ba1991b
14 changed files with 23 additions and 26 deletions

View File

@@ -1683,8 +1683,8 @@ void SmallMapWindow::SmallMapCenterOnCurrentPos()
*/
Point SmallMapWindow::GetStationMiddle(const Station *st) const
{
int x = (st->rect.right + st->rect.left + 1) / 2;
int y = (st->rect.bottom + st->rect.top + 1) / 2;
int x = CenterBounds(st->rect.left, st->rect.right, 0);
int y = CenterBounds(st->rect.top, st->rect.bottom, 0);
Point ret = this->RemapTile(x, y);
/* Same magic 3 as in DrawVehicles; that's where I got it from.