X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/343ef639a9c054e4d1883156b38a6b02fd629fd7..95912bdddeb21afe1cabc0401c0f8b8475a5e5c6:/src/richtext/richtextctrl.cpp diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index 08f62df425..14266aa8c1 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -1568,7 +1568,7 @@ bool wxRichTextCtrl::IsPositionVisible(long pos) const wxSize clientSize = GetClientSize(); clientSize.y -= GetBuffer().GetBottomMargin(); - return (rect.GetBottom() > (startY + GetBuffer().GetTopMargin())) && (rect.GetTop() < (startY + clientSize.y)); + return (rect.GetTop() >= (startY + GetBuffer().GetTopMargin())) && (rect.GetBottom() <= (startY + clientSize.y)); } void wxRichTextCtrl::SetCaretPosition(long position, bool showAtLineStart) @@ -3012,12 +3012,12 @@ void wxRichTextCtrl::Redo() bool wxRichTextCtrl::CanUndo() const { - return GetCommandProcessor()->CanUndo(); + return GetCommandProcessor()->CanUndo() && IsEditable(); } bool wxRichTextCtrl::CanRedo() const { - return GetCommandProcessor()->CanRedo(); + return GetCommandProcessor()->CanRedo() && IsEditable(); } // ----------------------------------------------------------------------------