]> git.saurik.com Git - wxWidgets.git/commitdiff
Correct selection/drop highlight rectangles width in generic wxDataViewCtrl.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 19 Dec 2009 11:17:42 +0000 (11:17 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 19 Dec 2009 11:17:42 +0000 (11:17 +0000)
The third parameter of wxRect ctor is the width, not the right edge.

See #11558.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62941 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/datavgen.cpp

index 2cb09a49ca22c0f102a9aeeda3866b319abc6599..cc597495d7bf57e549ba00971eefe4ef7c6a099c 100644 (file)
@@ -1656,7 +1656,8 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
             if (m_hasFocus)
                 flags |= wxCONTROL_FOCUSED;
 
-            wxRect rect( x_start, GetLineStart( item ), x_last, GetLineHeight( item ) );
+            wxRect rect( x_start, GetLineStart( item ),
+                         x_last - x_start, GetLineHeight( item ) );
             wxRendererNative::Get().DrawItemSelectionRect
                                 (
                                     this,
@@ -1671,7 +1672,7 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
     if (m_dropHint)
     {
         wxRect rect( x_start, GetLineStart( m_dropHintLine ),
-                    x_last, GetLineHeight( m_dropHintLine ) );
+                     x_last - x_start, GetLineHeight( m_dropHintLine ) );
         dc.SetPen( *wxBLACK_PEN );
         dc.SetBrush( *wxTRANSPARENT_BRUSH );
         dc.DrawRectangle( rect );