summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-16 11:54:59 +0000
committerrubidium <rubidium@openttd.org>2009-11-16 11:54:59 +0000
commitfd75575bdd3cbb335b182ae5872a16665cb57dfa (patch)
tree5fd9d38454eb2686093932970651b2fbbd8d9df6 /src
parentb02662c4c4277af3cc05e1985cac4edddfc5000c (diff)
downloadopenttd-fd75575bdd3cbb335b182ae5872a16665cb57dfa.tar.xz
(svn r18113) -Fix: RTL glitch in play heightmap window
Diffstat (limited to 'src')
-rw-r--r--src/genworld_gui.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp
index 5cc6ee931..e7f4ab1ee 100644
--- a/src/genworld_gui.cpp
+++ b/src/genworld_gui.cpp
@@ -476,9 +476,14 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow {
virtual void DrawWidget(const Rect &r, int widget) const
{
switch (widget) {
- case GLAND_HEIGHTMAP_NAME_TEXT:
- DrawString(r.left, this->width - WD_FRAMERECT_RIGHT, r.top, this->name, TC_ORANGE);
- break;
+ case GLAND_HEIGHTMAP_NAME_TEXT: {
+ /* Little bit of a hack going on here; just to get the widgets
+ * spaced without doing much magic. The space we can draw on is
+ * covered by both the spacer and text widgets, so take their
+ * outer most boundaries (left and right) as draw locations. */
+ const NWidgetCore *nwi_spacer = this->GetWidget<NWidgetCore>(GLAND_HEIGHTMAP_NAME_SPACER);
+ DrawString(min(r.left, nwi_spacer->pos_x), max<int>(r.right, nwi_spacer->pos_x + nwi_spacer->current_x), r.top, this->name, TC_ORANGE);
+ } break;
}
}