From e3bcc1dc0916a107b7213674fd407a5828fd1421 Mon Sep 17 00:00:00 2001 From: Alexandre Deckner Date: Fri, 31 Oct 2008 15:59:00 +0000 Subject: [PATCH] * Combine the two calls to ScrollBy into one. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28405 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/ContainerWindow.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/kits/tracker/ContainerWindow.cpp b/src/kits/tracker/ContainerWindow.cpp index 58c8f19f1a..0ac8c2aea4 100644 --- a/src/kits/tracker/ContainerWindow.cpp +++ b/src/kits/tracker/ContainerWindow.cpp @@ -1085,14 +1085,20 @@ BContainerWindow::FrameResized(float, float) // scroll when the size augmented, there is a negative offset // and we have resized over the bottom right corner of the extent + BPoint scroll(B_ORIGIN); if (offsetX < 0 && PoseView()->Bounds().right > extent.right && Bounds().Width() > fPreviousBounds.Width()) - PoseView()->ScrollBy(max_c(fPreviousBounds.Width() - Bounds().Width(), offsetX), 0); + scroll.x = + max_c(fPreviousBounds.Width() - Bounds().Width(), offsetX); if (offsetY < 0 && PoseView()->Bounds().bottom > extent.bottom && Bounds().Height() > fPreviousBounds.Height()) - PoseView()->ScrollBy(0, max_c(fPreviousBounds.Height() - Bounds().Height(), offsetY)); + scroll.y = + max_c(fPreviousBounds.Height() - Bounds().Height(), offsetY); + if (scroll != B_ORIGIN) + PoseView()->ScrollBy(scroll.x, scroll.y); + PoseView()->UpdateScrollRange(); PoseView()->ResetPosePlacementHint(); }