- revert my last changes to ScrollBy, this temporarily bring back #2312

and the previously mentioned ResizeToFit issue.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26047 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexandre Deckner
2008-06-20 20:04:10 +00:00
parent 2fd41f637c
commit 1c4b7e9e01
+20
View File
@@ -1507,6 +1507,26 @@ BView::ScrollTo(BPoint where)
if (where.x == fBounds.left && where.y == fBounds.top) if (where.x == fBounds.left && where.y == fBounds.top)
return; return;
// make sure scrolling is within valid bounds
if (fHorScroller) {
float min, max;
fHorScroller->GetRange(&min, &max);
if (where.x < min)
where.x = min;
else if (where.x > max)
where.x = max;
}
if (fVerScroller) {
float min, max;
fVerScroller->GetRange(&min, &max);
if (where.y < min)
where.y = min;
else if (where.y > max)
where.y = max;
}
_CheckLockAndSwitchCurrent(); _CheckLockAndSwitchCurrent();
// if we're attached to a window tell app_server about this change // if we're attached to a window tell app_server about this change