From 113faca13fe634e34752e63530409ee40f84334f Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 27 Oct 2006 12:40:40 +0000 Subject: [PATCH] Fixed caret droppings left when scrolling git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42520 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/window.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index d986f1f4a6..c631f3b014 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -4235,6 +4235,26 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) ) gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy ); m_clipPaintRegion = false; + + bool restoreCaret = (GetCaret() != NULL && GetCaret()->IsVisible()); + if (restoreCaret) + { + wxRect caretRect(GetCaret()->GetPosition(), GetCaret()->GetSize()); + if (dx > 0) + caretRect.width += dx; + else + { + caretRect.x += dx; caretRect.width -= dx; + } + if (dy > 0) + caretRect.height += dy; + else + { + caretRect.y += dy; caretRect.height -= dy; + } + + RefreshRect(caretRect); + } } void wxWindowGTK::GtkScrolledWindowSetBorder(GtkWidget* w, int wxstyle) -- 2.45.2