diff options
author | frosch <frosch@openttd.org> | 2016-12-25 17:56:57 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2016-12-25 17:56:57 +0000 |
commit | 3419bff4ed1e3cab9ed1e2374f6269e2d7321135 (patch) | |
tree | 4b1cb4133e7c4bb8f170f1db7ab247e545ff2a30 | |
parent | eae9234c07d1d45feb4468c239dd6d0229e5a7f8 (diff) | |
download | openttd-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.cpp | 2 |
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)); } } } |