- Scrollbar proportions computation was wrong in icon mode. The problem showed when a folder contained few icons regrouped in a small area (Extent() smaller than Bounds()). The viewable extent is

always Bounds() now.

 This fixes #361, again we're better than R5! Although in this test case, the scrollbars shouldn't be activated in the first place. In icon mode the poseview is still putting too much white space on 
the left (x<0) and make the scrollbars show. Fix is almost ready :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25896 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexandre Deckner 2008-06-10 00:52:01 +00:00
parent c0179e0856
commit ed27e7aef6

View File

@ -7988,17 +7988,16 @@ BPoseView::UpdateScrollRange()
}
// set proportions for bars
BRect visibleExtent(extent & bounds);
BRect totalExtent(extent | bounds);
if (fHScrollBar) {
float proportion = visibleExtent.Width() / totalExtent.Width();
if (fHScrollBar && totalExtent.Width() != 0.0) {
float proportion = bounds.Width() / totalExtent.Width();
if (fHScrollBar->Proportion() != proportion)
fHScrollBar->SetProportion(proportion);
}
if (fVScrollBar) {
float proportion = visibleExtent.Height() / totalExtent.Height();
if (fVScrollBar && totalExtent.Height() != 0.0) {
float proportion = bounds.Height() / totalExtent.Height();
if (fVScrollBar->Proportion() != proportion)
fVScrollBar->SetProportion(proportion);
}