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.
This commit is contained in:
Ryan Leavengood 2012-06-24 16:42:12 -04:00
parent 43ae772868
commit 2804cb332f

View File

@ -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(