summaryrefslogtreecommitdiff
path: root/src/widget.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-08-04 05:59:28 +0000
committerpeter1138 <peter1138@openttd.org>2008-08-04 05:59:28 +0000
commit8018aeac9f6907b434f74b52b7208395c5d11ef3 (patch)
tree0498a904f3a3c11520922161338cb3bcae86f889 /src/widget.cpp
parentbea84ea8d908c0fc4bbe3cce6c6791c1c03a6dd3 (diff)
downloadopenttd-8018aeac9f6907b434f74b52b7208395c5d11ef3.tar.xz
(svn r13987) -Codechange: Resize small map legend dynamically on window resize and when switching small map types, so that the legend is taller only on the industry type and only when the legend will not fit in the available space.
Diffstat (limited to 'src/widget.cpp')
-rw-r--r--src/widget.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/widget.cpp b/src/widget.cpp
index aa93317d2..f6401e14d 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -607,6 +607,9 @@ void ResizeWindowForWidget(Window *w, uint widget, int delta_x, int delta_y)
if (right == w->widget[widget].left) w->widget[widget].right--;
if (bottom == w->widget[widget].top) w->widget[widget].bottom--;
+ if (w->widget[widget].left > w->widget[widget].right) w->widget[widget].right = w->widget[widget].left;
+ if (w->widget[widget].top > w->widget[widget].bottom) w->widget[widget].bottom = w->widget[widget].top;
+
w->width += delta_x;
w->height += delta_y;
w->resize.width += delta_x;