From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Mon, 4 Feb 2002 01:32:55 +0000 (+0000)
Subject: ScrollWindow() should use the rect it scrolls as the clipping rect as well
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f797e53d03fd79733e78dda8dd8c4203009e1c31

ScrollWindow() should use the rect it scrolls as the clipping rect as well


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13985 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/msw/window.cpp b/src/msw/window.cpp
index 738f94dda0..285299a2ff 100644
--- a/src/msw/window.cpp
+++ b/src/msw/window.cpp
@@ -901,16 +901,22 @@ void wxWindowMSW::SetScrollbar(int orient, int pos, int thumbVisible,
 
 void wxWindowMSW::ScrollWindow(int dx, int dy, const wxRect *prect)
 {
-    RECT rect;
+    RECT rect, *pr;
     if ( prect )
     {
         rect.left = prect->x;
         rect.top = prect->y;
         rect.right = prect->x + prect->width;
         rect.bottom = prect->y + prect->height;
+
+        pr = &rect;
+    }
+    else
+    {
+        pr = NULL;
     }
 
-    ::ScrollWindow(GetHwnd(), dx, dy, prect ? &rect : NULL, NULL);
+    ::ScrollWindow(GetHwnd(), dx, dy, pr, pr);
 }
 
 static bool ScrollVertically(HWND hwnd, int kind, int count)