From 3419bff4ed1e3cab9ed1e2374f6269e2d7321135 Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 25 Dec 2016 17:56:57 +0000 Subject: [PATCH] (svn r27712) -Codechange: Reduce recursions in DrawOverlappedWindow by limiting the area to the window bounds first. (adf88) --- src/window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.cpp b/src/window.cpp index 24683d0a6a..0ffbf8bf1b 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)); } } }