diff options
author | alberth <alberth@openttd.org> | 2009-04-12 15:30:16 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-04-12 15:30:16 +0000 |
commit | d0f91fbea277198b79183a88a2e80473aa8de678 (patch) | |
tree | 10ad8914ec6ccd1348b2034b5a8199dfcfa49af0 /src | |
parent | 0196f06744a5020182ef4679d11097fd8c1cc2f5 (diff) | |
download | openttd-d0f91fbea277198b79183a88a2e80473aa8de678.tar.xz |
(svn r16040) -Codechange: Use coordinates from the widget for the town-view viewport instead of magic constants.
Diffstat (limited to 'src')
-rw-r--r-- | src/town_gui.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 1afdf68eb..ab30a2295 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -246,7 +246,9 @@ public: bool ingame = _game_mode != GM_EDITOR; this->flags4 |= WF_DISABLE_VP_SCROLL; - InitializeWindowViewport(this, 3, 17, 254, 86, this->town->xy, ZOOM_LVL_TOWN); + int width = this->widget[TVW_VIEWPORTINSET].right - this->widget[TVW_VIEWPORTINSET].left - 1; + int height = this->widget[TVW_VIEWPORTINSET].bottom - this->widget[TVW_VIEWPORTINSET].top - 1; + InitializeWindowViewport(this, this->widget[TVW_VIEWPORTINSET].left + 1, this->widget[TVW_VIEWPORTINSET].top + 1, width, height, this->town->xy, ZOOM_LVL_TOWN); if (this->town->larger_town) this->widget[TVW_CAPTION].data = STR_CITY; this->SetWidgetHiddenState(TVW_DELETE, ingame); // hide delete button on game mode |