summaryrefslogtreecommitdiff
path: root/src/industry_gui.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-10-23 20:34:12 +0000
committeralberth <alberth@openttd.org>2010-10-23 20:34:12 +0000
commitcccbc8f418b578d4ad378e5c0570b7f473391ce8 (patch)
tree1d22e22d2d8c5fd3cae84e99143f2f2239dc68ea /src/industry_gui.cpp
parent8f24ec94717ec7de4d2483e3c8eb8f0f042f9b5c (diff)
downloadopenttd-cccbc8f418b578d4ad378e5c0570b7f473391ce8.tar.xz
(svn r21019) -Add: Use center of industry to focus on in the industry gui.
Diffstat (limited to 'src/industry_gui.cpp')
-rw-r--r--src/industry_gui.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 5cdc04136..962a59532 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -673,7 +673,7 @@ public:
this->InitNested(desc, window_number);
NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(IVW_VIEWPORT);
- nvp->InitializeViewport(this, Industry::Get(window_number)->location.tile + TileDiffXY(1, 1), ZOOM_LVL_INDUSTRY);
+ nvp->InitializeViewport(this, Industry::Get(window_number)->location.GetCenterTile(), ZOOM_LVL_INDUSTRY);
this->InvalidateData();
}
@@ -900,9 +900,9 @@ public:
case IVW_GOTO: {
Industry *i = Industry::Get(this->window_number);
if (_ctrl_pressed) {
- ShowExtraViewPortWindow(i->location.tile + TileDiffXY(1, 1));
+ ShowExtraViewPortWindow(i->location.GetCenterTile());
} else {
- ScrollMainWindowToTile(i->location.tile + TileDiffXY(1, 1));
+ ScrollMainWindowToTile(i->location.GetCenterTile());
}
break;
}