diff options
author | peter1138 <peter1138@openttd.org> | 2014-10-05 14:01:44 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2014-10-05 14:01:44 +0000 |
commit | a573b9486748c676eb58c58fb8c1408c8691afc2 (patch) | |
tree | 8c5c381093a579f31373ae12028c2499ff98abf2 /src | |
parent | 0877f892c5a3dbffef8f482c9b0c35bd41f77cee (diff) | |
download | openttd-a573b9486748c676eb58c58fb8c1408c8691afc2.tar.xz |
(svn r26961) -Codechange: GUI-scale for landscape editor terraform window.
Diffstat (limited to 'src')
-rw-r--r-- | src/terraform_gui.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index d2e7d39e1..3642af4e6 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -32,6 +32,7 @@ #include "hotkeys.h" #include "engine_base.h" #include "terraform_gui.h" +#include "zoom_func.h" #include "widgets/terraform_widget.h" @@ -554,6 +555,14 @@ struct ScenarioEditorLandscapeGenerationWindow : Window { } } + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + { + if (widget != WID_ETT_DOTS) return; + + size->width = max<uint>(size->width, UnScaleByZoom(4 * 59, ZOOM_LVL_GUI)); + size->height = max<uint>(size->height, UnScaleByZoom(4 * 31, ZOOM_LVL_GUI)); + } + virtual void DrawWidget(const Rect &r, int widget) const { if (widget != WID_ETT_DOTS) return; @@ -566,7 +575,7 @@ struct ScenarioEditorLandscapeGenerationWindow : Window { assert(n != 0); do { - DrawSprite(SPR_WHITE_POINT, PAL_NONE, center_x + coords[0], center_y + coords[1]); + DrawSprite(SPR_WHITE_POINT, PAL_NONE, center_x + UnScaleByZoom(4 * coords[0], ZOOM_LVL_GUI), center_y + UnScaleByZoom(4 * coords[1], ZOOM_LVL_GUI)); coords += 2; } while (--n); } |