From b6889daf8d11b083358a26eea3f633942e2e50e4 Mon Sep 17 00:00:00 2001 From: alberth Date: Thu, 16 Jul 2009 18:31:33 +0000 Subject: (svn r16848) -Fix: Trying to reduce a nested widget window further than the smallest alowed size should not crash the game. --- src/window.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/window.cpp b/src/window.cpp index 39fdaa2e7..86b774364 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1478,8 +1478,8 @@ void ResizeWindow(Window *w, int delta_x, int delta_y) w->SetDirty(); if (w->nested_root != NULL) { - uint new_xinc = max(0u, (w->nested_root->resize_x == 0) ? 0 : (w->nested_root->current_x - w->nested_root->smallest_x) + delta_x); - uint new_yinc = max(0u, (w->nested_root->resize_y == 0) ? 0 : (w->nested_root->current_y - w->nested_root->smallest_y) + delta_y); + uint new_xinc = max(0, (w->nested_root->resize_x == 0) ? 0 : (int)(w->nested_root->current_x - w->nested_root->smallest_x) + delta_x); + uint new_yinc = max(0, (w->nested_root->resize_y == 0) ? 0 : (int)(w->nested_root->current_y - w->nested_root->smallest_y) + delta_y); assert(w->nested_root->resize_x == 0 || new_xinc % w->nested_root->resize_x == 0); assert(w->nested_root->resize_y == 0 || new_yinc % w->nested_root->resize_y == 0); -- cgit v1.2.3-54-g00ecf