Fixed: overlay scroll knobs never quite reached the edge.

The calculation of the number of pixels outside of the clip view assumed fixed, space consuming scrollbars even when overlay scrollbars were used, leading CPScrollView to always think a few more pixels could be revealed.
This commit is contained in:
Alexander Ljungberg committed 2011-10-27 15:57:29 +01:00
1 parent 208c3fea35
commit 63c500c444
1 file changed
+4 -2
+4 -2
View File
@@ -1090,14 +1090,16 @@ var CPScrollerStyleGlobal = CPScrollerStyleOverlay,
// Now we have to account for the shown scrollers affecting the deltas.
if (shouldShowVerticalScroller)
{
difference.width += verticalScrollerWidth;
if (_scrollerStyle === CPScrollerStyleLegacy)
difference.width += verticalScrollerWidth;
hasHorizontalScroll = difference.width > 0.0;
shouldShowHorizontalScroller = _hasHorizontalScroller && (!_autohidesScrollers || hasHorizontalScroll);
}
if (shouldShowHorizontalScroller)
{
difference.height += horizontalScrollerHeight;
if (_scrollerStyle === CPScrollerStyleLegacy)
difference.height += horizontalScrollerHeight;
hasVerticalScroll = difference.height > 0.0;
shouldShowVerticalScroller = _hasVerticalScroller && (!_autohidesScrollers || hasVerticalScroll);
}