summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2016-12-25 17:56:57 +0000
committerfrosch <frosch@openttd.org>2016-12-25 17:56:57 +0000
commit3419bff4ed1e3cab9ed1e2374f6269e2d7321135 (patch)
tree4b1cb4133e7c4bb8f170f1db7ab247e545ff2a30
parenteae9234c07d1d45feb4468c239dd6d0229e5a7f8 (diff)
downloadopenttd-3419bff4ed1e3cab9ed1e2374f6269e2d7321135.tar.xz
(svn r27712) -Codechange: Reduce recursions in DrawOverlappedWindow by limiting the area to the window bounds first. (adf88)
-rw-r--r--src/window.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 24683d0a6..0ffbf8bf1 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -942,7 +942,7 @@ void DrawOverlappedWindowForAll(int left, int top, int right, int bottom)
left < w->left + w->width &&
top < w->top + w->height) {
/* Window w intersects with the rectangle => needs repaint */
- DrawOverlappedWindow(w, left, top, right, bottom);
+ DrawOverlappedWindow(w, max(left, w->left), max(top, w->top), min(right, w->left + w->width), min(bottom, w->top + w->height));
}
}
}