summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-12-09 22:07:00 +0000
committerrubidium <rubidium@openttd.org>2011-12-09 22:07:00 +0000
commit6153dc57f5ec5f24868703133a0a1295e2e1971f (patch)
tree08b7d43ad6e8023cd8680d0b19bf6416ada236b0 /src/window.cpp
parentdcba6c25ea0cad50dc779f8df359bdd45b6def26 (diff)
downloadopenttd-6153dc57f5ec5f24868703133a0a1295e2e1971f.tar.xz
(svn r23466) -Fix [FS#4871, FS#4874]: assertion triggered when resizing a window during ReInit by an amount that's not a multiple of the resize interval
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 285a18711..9241f6c84 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1675,8 +1675,8 @@ void ResizeWindow(Window *w, int delta_x, int delta_y)
* the resolution clamp it in such a manner that it stays within the bounts. */
int new_right = w->left + w->width + delta_x;
int new_bottom = w->top + w->height + delta_y;
- if (new_right >= (int)_cur_resolution.width) delta_x -= new_right - _cur_resolution.width;
- if (new_bottom >= (int)_cur_resolution.height) delta_y -= new_bottom - _cur_resolution.height;
+ if (new_right >= (int)_cur_resolution.width) delta_x -= Ceil(new_right - _cur_resolution.width, max(1U, w->nested_root->resize_x));
+ if (new_bottom >= (int)_cur_resolution.height) delta_y -= Ceil(new_bottom - _cur_resolution.height, max(1U, w->nested_root->resize_y));
w->SetDirty();