diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index dc03aabf5c..5af35016f4 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -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; diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 196eeb74cb..71253a2c5a 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -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); } }