]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix for #11647: text from WriteText not scrolled to be visible in wxRichTextCtrl
authorJulian Smart <julian@anthemion.co.uk>
Fri, 25 Feb 2011 17:28:27 +0000 (17:28 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 25 Feb 2011 17:28:27 +0000 (17:28 +0000)
IsPositionVisible was incorrect.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67026 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextctrl.cpp

index cbe4d43fc8b06a0dd476f22f699485953e36ae7c..14266aa8c1a72e1bae62b86afd032040bd6ed87d 100644 (file)
@@ -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)