From 0b289133089a070e3538214cfd73209b65b8ff5c Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 14 Mar 2013 22:32:03 +0000 Subject: [PATCH] Corrected wxRichTextCaret refresh git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73664 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextctrl.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index 044d3c2376..ce93c740a3 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -3757,7 +3757,9 @@ void wxRichTextCtrl::PositionCaret(wxRichTextParagraphLayoutBox* container) wxRect caretRect; if (GetCaretPositionForIndex(GetCaretPosition(), caretRect, container)) { +#if !wxRICHTEXT_USE_OWN_CARET caretRect = GetScaledRect(caretRect); +#endif int topMargin = (int) (0.5 + GetScale()*GetBuffer().GetTopMargin()); int bottomMargin = (int) (0.5 + GetScale()*GetBuffer().GetBottomMargin()); wxPoint newPt = caretRect.GetPosition(); @@ -4799,8 +4801,9 @@ void wxRichTextCaret::DoMove() { if (m_richTextCtrl && m_refreshEnabled) { - wxRect rect(GetPosition(), GetSize()); - m_richTextCtrl->RefreshRect(rect, false); + wxRect rect(wxPoint(m_xOld, m_yOld), GetSize()); + wxRect scaledRect = m_richTextCtrl->GetScaledRect(rect); + m_richTextCtrl->RefreshRect(scaledRect, false); } } } @@ -4851,7 +4854,8 @@ void wxRichTextCaret::Refresh() if (m_richTextCtrl && m_refreshEnabled) { wxRect rect(GetPosition(), GetSize()); - m_richTextCtrl->RefreshRect(rect, false); + wxRect rectScaled = m_richTextCtrl->GetScaledRect(rect); + m_richTextCtrl->RefreshRect(rectScaled, false); } } -- 2.45.2