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
This commit is contained in:
Stephan Aßmus
2008-02-26 11:48:36 +00:00
parent ee0a072929
commit a01db67de0
+4 -2
View File
@@ -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)