From 2804cb332fca17a37d42fc3cb10e2255ebddb834 Mon Sep 17 00:00:00 2001 From: Ryan Leavengood Date: Sun, 24 Jun 2012 16:42:12 -0400 Subject: [PATCH] Fix off-by-one error which caused scrolling artifacts. Based on printf debugging the correct left value is actually -1, not 0, but instead of hard-coding numbers it makes more sense to use the existing value. I'm not sure if a -1 left value makes much sense, but overall this seems to work and does not have the scrolling artifacts. But overall I think ShowImage needs more layout management. Doing all this moving and resizing manually is error prone. Fixes #8648. --- src/apps/showimage/ShowImageWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/showimage/ShowImageWindow.cpp b/src/apps/showimage/ShowImageWindow.cpp index 6430c23d39..6aa6e9f613 100644 --- a/src/apps/showimage/ShowImageWindow.cpp +++ b/src/apps/showimage/ShowImageWindow.cpp @@ -1059,7 +1059,7 @@ ShowImageWindow::MessageReceived(BMessage* message) } BRect frame = fToolBarView->Parent()->Bounds(); frame.top = fToolBarView->Frame().bottom + 1; - fScrollView->MoveTo(0, frame.top); + fScrollView->MoveTo(fScrollView->Frame().left, frame.top); fScrollView->ResizeTo(fScrollView->Bounds().Width(), frame.Height() - B_H_SCROLL_BAR_HEIGHT + 1); fVerticalScrollBar->MoveTo(