]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed RefreshRect() call in wxPropertyGrid::DrawItems() to use physical window coordi...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Mon, 22 Mar 2010 16:07:45 +0000 (16:07 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Mon, 22 Mar 2010 16:07:45 +0000 (16:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63738 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/propgrid/propgrid.h
src/propgrid/propgrid.cpp

index dc03aabf5c03dd99ef3a9e7b230823acb03c8427..5af35016f450e7fb81860ae447f21e60ab67dc02 100644 (file)
@@ -1433,7 +1433,7 @@ public:
 
     /**
         Returns rectangle that fully contains properties between and including
-        p1 and p2.
+        p1 and p2. Rectangle is in virtual scrolled window coordinates.
     */
     wxRect GetPropertyRect( const wxPGProperty* p1,
                             const wxPGProperty* p2 ) const;
index 196eeb74cb9a1fca46fd33466091769d6a2af0cc..71253a2c5a956fd0595f1d465843bd7ba040f948 100644 (file)
@@ -2530,6 +2530,8 @@ wxRect wxPropertyGrid::GetPropertyRect( const wxPGProperty* p1, const wxPGProper
 
     //
     // Return rect which encloses the given property range
+    // (in logical grid coordinates)
+    // 
 
     int visTop = p1->GetY();
     int visBottom;
@@ -2572,6 +2574,13 @@ void wxPropertyGrid::DrawItems( const wxPGProperty* p1, const wxPGProperty* p2 )
     wxRect r = GetPropertyRect(p1, p2);
     if ( r.width > 0 )
     {
+        // Convert rectangle from logical grid coordinates to physical ones
+        int vx, vy;
+        GetViewStart(&vx, &vy);
+        vx *= wxPG_PIXELS_PER_UNIT;
+        vy *= wxPG_PIXELS_PER_UNIT;
+        r.x -= vx;
+        r.y -= vy;
         RefreshRect(r);
     }
 }