]> git.saurik.com Git - wxWidgets.git/commitdiff
A little less flicker when selecting text.
authorRobert Roebling <robert@roebling.de>
Mon, 8 Apr 2002 18:05:44 +0000 (18:05 +0000)
committerRobert Roebling <robert@roebling.de>
Mon, 8 Apr 2002 18:05:44 +0000 (18:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15038 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/x11/textctrl.cpp

index 6fd8e22899194254b3f7b4f6ecb43a2ec713ae1f..95cd5e86af26ee17da7bc842dca93329b840c59d 100644 (file)
@@ -2234,6 +2234,7 @@ void wxTextCtrl::MoveCursor( int new_x, int new_y, bool shift, bool centre )
     if (shift)
     {
         int x,y,w,h;
+        bool erase_background = TRUE;
         
         if (!has_selection)
         {
@@ -2298,11 +2299,17 @@ void wxTextCtrl::MoveCursor( int new_x, int new_y, bool shift, bool centre )
                 {
                     y = m_selEndY*m_lineHeight;
                     h = (new_y-m_selEndY+1) * m_lineHeight;
+                    
+                    erase_background = ((m_selEndY < m_selStartY) ||
+                                        ((m_selEndY == m_selStartY) && (m_selEndX < m_selStartX)));
                 }
                 else
                 {
                     y = new_y*m_lineHeight;
                     h = (-new_y+m_selEndY+1) * m_lineHeight;
+                    
+                    erase_background = ((m_selEndY > m_selStartY) ||
+                                        ((m_selEndY == m_selStartY) && (m_selEndX > m_selStartX)));
                 }
                 no_cursor_refresh = TRUE;
                 m_cursorX = new_x;
@@ -2315,7 +2322,7 @@ void wxTextCtrl::MoveCursor( int new_x, int new_y, bool shift, bool centre )
         
         CalcScrolledPosition( x, y, &x, &y );
         wxRect rect( x+2, y+2, w, h );
-        Refresh( TRUE, &rect );
+        Refresh( erase_background, &rect );
     }
     else
     {