From a01db67de036d8a38a77d2f9a00b0d346442b0e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Tue, 26 Feb 2008 11:48:36 +0000 Subject: [PATCH] Do not scroll to the bottom of the current line if that means the top of the line will be scrolled out of view. (Fixes text jumping one pixel up/down in Vision with each new char you type into Visions text box.) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24136 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/TextView.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/TextView.cpp b/src/kits/interface/TextView.cpp index eb0c81756a..ea5ee1966e 100644 --- a/src/kits/interface/TextView.cpp +++ b/src/kits/interface/TextView.cpp @@ -1917,14 +1917,16 @@ BTextView::ScrollToOffset(int32 inOffset) if (point.x < bounds.left) xDiff = point.x - bounds.left - extraSpace; - else if (point.x >= bounds.right) + else if (point.x > bounds.right) xDiff = point.x - bounds.right + extraSpace; // vertical if (point.y < bounds.top) yDiff = point.y - bounds.top; - else if (point.y + lineHeight >= bounds.bottom) + else if (point.y + lineHeight > bounds.bottom + && point.y - lineHeight > bounds.top) { yDiff = point.y + lineHeight - bounds.bottom; + } // prevent negative scroll offset if (bounds.left + xDiff < 0.0)