(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.

This commit is contained in:
peter1138
2008-08-04 05:59:28 +00:00
parent bea84ea8d9
commit 8018aeac9f
2 changed files with 52 additions and 23 deletions

View File

@@ -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;