Fix wxDV_ROW_LINES drawing when horizontally scrolled in generic version.

Use the correct, i.e. logical, as wxDC does the translation to physical
internally, coordinates for drawing the highlighted rows.

Closes #16815.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78502 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2015-02-15 22:54:50 +00:00
parent 44dc3e20df
commit 64797a78ea

View File

@@ -1807,9 +1807,11 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
wxDataViewModel *model = GetModel();
wxAutoBufferedPaintDC dc( this );
const wxSize size = GetClientSize();
dc.SetBrush(GetOwner()->GetBackgroundColour());
dc.SetPen( *wxTRANSPARENT_PEN );
dc.DrawRectangle(GetClientSize());
dc.DrawRectangle(size);
if ( IsEmpty() )
{
@@ -1895,13 +1897,16 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
dc.SetPen(*wxTRANSPARENT_PEN);
dc.SetBrush(wxBrush(altRowColour));
// We only need to draw the visible part, so limit the rectangle to it.
const int xRect = m_owner->CalcUnscrolledPosition(wxPoint(0, 0)).x;
const int widthRect = size.x;
for (unsigned int item = item_start; item < item_last; item++)
{
if ( item % 2 )
{
dc.DrawRectangle(x_start,
dc.DrawRectangle(xRect,
GetLineStart(item),
GetClientSize().GetWidth(),
widthRect,
GetLineHeight(item));
}
}