]> git.saurik.com Git - wxWidgets.git/commitdiff
wxTLW::DoRefreshRect must check the rect, too
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 13 Sep 2006 11:01:10 +0000 (11:01 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 13 Sep 2006 11:01:10 +0000 (11:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41187 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/dfb/toplevel.cpp

index 3aebd23e4041ffb48ff497290429a1810a9586f1..b607ecc863cc93b0b33c32a965e986fc8f202652 100644 (file)
@@ -441,7 +441,11 @@ void wxTopLevelWindowDFB::HandleQueuedPaintRequests()
 
 void wxTopLevelWindowDFB::DoRefreshRect(const wxRect& rect)
 {
 
 void wxTopLevelWindowDFB::DoRefreshRect(const wxRect& rect)
 {
-    wxASSERT_MSG( rect.width > 0 && rect.height > 0, _T("invalid rect") );
+    // don't overlap outside of the window (NB: 'rect' is in window coords):
+    wxRect r(rect);
+    r.Intersect(wxRect(GetSize()));
+    if ( r.IsEmpty() )
+        return;
 
     wxLogTrace(TRACE_PAINT,
                _T("%p ('%s'): [TLW] refresh rect [%i,%i,%i,%i]"),
 
     wxLogTrace(TRACE_PAINT,
                _T("%p ('%s'): [TLW] refresh rect [%i,%i,%i,%i]"),