]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
window clipper added
[wxWidgets.git] / src / generic / listctrl.cpp
index ae100c27250d3ba8201dd963f01ebae954f4bb31..aeee3f956f66fa30bc52973e5dd919ca68737614 100644 (file)
@@ -2672,22 +2672,24 @@ void wxListMainWindow::RefreshAfter( size_t lineFrom )
 {
     if ( HasFlag(wxLC_REPORT) )
     {
-        size_t visibleFrom;
-        GetVisibleLinesRange(&visibleFrom, NULL);
+        size_t visibleFrom, visibleTo;
+        GetVisibleLinesRange(&visibleFrom, &visibleTo);
 
         if ( lineFrom < visibleFrom )
             lineFrom = visibleFrom;
+        else if ( lineFrom > visibleTo )
+            return;
 
         wxRect rect;
         rect.x = 0;
         rect.y = GetLineY(lineFrom);
+        CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y );
 
         wxSize size = GetClientSize();
         rect.width = size.x;
         // refresh till the bottom of the window
         rect.height = size.y - rect.y;
 
-        CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y );
         RefreshRect( rect );
     }
     else // !report