Fix determining shift of the drawn scrolled contents
Position of the visible portion of the window should be taken as a drawing offset. See #18313.
This commit is contained in:
@@ -2028,7 +2028,7 @@ void wxPropertyGrid::DrawItems( wxDC& dc,
|
|||||||
#if WXWIN_COMPATIBILITY_3_0
|
#if WXWIN_COMPATIBILITY_3_0
|
||||||
int wxPropertyGrid::DoDrawItemsBase( wxDC& dc,
|
int wxPropertyGrid::DoDrawItemsBase( wxDC& dc,
|
||||||
const wxRect* itemsRect,
|
const wxRect* itemsRect,
|
||||||
bool isBuffered ) const
|
bool WXUNUSED(isBuffered) ) const
|
||||||
#else
|
#else
|
||||||
int wxPropertyGrid::DoDrawItems( wxDC& dc,
|
int wxPropertyGrid::DoDrawItems( wxDC& dc,
|
||||||
const wxRect* itemsRect ) const
|
const wxRect* itemsRect ) const
|
||||||
@@ -2043,8 +2043,9 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc,
|
|||||||
if ( !lastItem )
|
if ( !lastItem )
|
||||||
lastItem = GetLastItem( wxPG_ITERATE_VISIBLE );
|
lastItem = GetLastItem( wxPG_ITERATE_VISIBLE );
|
||||||
|
|
||||||
int vy;
|
int vx, vy;
|
||||||
GetViewStart(NULL, &vy);
|
GetViewStart(&vx, &vy);
|
||||||
|
vx *= wxPG_PIXELS_PER_UNIT;
|
||||||
vy *= wxPG_PIXELS_PER_UNIT;
|
vy *= wxPG_PIXELS_PER_UNIT;
|
||||||
|
|
||||||
if ( IsFrozen() || m_height < 1 || firstItem == NULL )
|
if ( IsFrozen() || m_height < 1 || firstItem == NULL )
|
||||||
@@ -2090,22 +2091,10 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc,
|
|||||||
|
|
||||||
long windowStyle = m_windowStyle;
|
long windowStyle = m_windowStyle;
|
||||||
|
|
||||||
#if WXWIN_COMPATIBILITY_3_0
|
int xRelMod = vx;
|
||||||
int xRelMod = 0;
|
|
||||||
|
|
||||||
if ( isBuffered )
|
|
||||||
{
|
|
||||||
xRelMod = itemsRect->x;
|
|
||||||
// itemsRect conversion
|
// itemsRect conversion
|
||||||
firstItemTopY -= vy;
|
firstItemTopY -= vy;
|
||||||
lastItemBottomY -= vy;
|
lastItemBottomY -= vy;
|
||||||
}
|
|
||||||
#else
|
|
||||||
int xRelMod = itemsRect->x;
|
|
||||||
// itemsRect conversion
|
|
||||||
firstItemTopY -= vy;
|
|
||||||
lastItemBottomY -= vy;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int x = m_marginWidth - xRelMod;
|
int x = m_marginWidth - xRelMod;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user