X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/914a4e23e40db922ba3ca1b8014f2643729415f9..49b18c6cd9dbb87fa53f4000d63e0667bce50227:/src/richtext/richtextctrl.cpp diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index 3e0b4c7a4a..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(); @@ -3890,6 +3892,7 @@ bool wxRichTextCtrl::LayoutContent(bool onlyVisibleRect) PrepareDC(dc); dc.SetFont(GetFont()); + dc.SetUserScale(GetScale(), GetScale()); wxRichTextDrawingContext context(& GetBuffer()); GetBuffer().Defragment(context); @@ -3897,6 +3900,8 @@ bool wxRichTextCtrl::LayoutContent(bool onlyVisibleRect) GetBuffer().Layout(dc, context, availableSpace, availableSpace, flags); GetBuffer().Invalidate(wxRICHTEXT_NONE); + dc.SetUserScale(1.0, 1.0); + if (!IsFrozen() && !onlyVisibleRect) SetupScrollbars(); } @@ -4796,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); } } } @@ -4848,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); } }