From 1c4b7e9e01942386c5e526bd237b1ef9080604e4 Mon Sep 17 00:00:00 2001 From: Alexandre Deckner Date: Fri, 20 Jun 2008 20:04:10 +0000 Subject: [PATCH] - 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 --- src/kits/interface/View.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index b1627b817f..c719b1c7f2 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -1506,6 +1506,26 @@ BView::ScrollTo(BPoint where) // no reason to process this further if no scroll is intended. if (where.x == fBounds.left && where.y == fBounds.top) 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();