* fixed ScrollView framework to support data rects with negative left/top
coordinate correctly git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21488 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -662,11 +662,11 @@ ScrollView::_UpdateScrollBars()
|
||||
float hProportion = min(1.0f, (visibleBounds.Width() + 1.0f) /
|
||||
(dataRect.Width() + 1.0f));
|
||||
float hMaxValue = max(dataRect.left,
|
||||
dataRect.Width() - visibleBounds.Width());
|
||||
dataRect.right - visibleBounds.Width());
|
||||
float vProportion = min(1.0f, (visibleBounds.Height() + 1.0f) /
|
||||
(dataRect.Height() + 1.0f));
|
||||
float vMaxValue = max(dataRect.top,
|
||||
dataRect.Height() - visibleBounds.Height());
|
||||
dataRect.bottom - visibleBounds.Height());
|
||||
// update horizontal scroll bar
|
||||
if (fHScrollBar) {
|
||||
fHScrollBar->SetProportion(hProportion);
|
||||
|
||||
@@ -211,8 +211,8 @@ Scrollable::ScrollSourceChanged(Scroller* /*oldSource*/,
|
||||
BPoint
|
||||
Scrollable::_ValidScrollOffsetFor(BPoint offset) const
|
||||
{
|
||||
float maxX = max(fDataRect.left, fDataRect.Width() - fVisibleWidth);
|
||||
float maxY = max(fDataRect.top, fDataRect.Height() - fVisibleHeight);
|
||||
float maxX = max(fDataRect.left, fDataRect.right - fVisibleWidth);
|
||||
float maxY = max(fDataRect.top, fDataRect.bottom - fVisibleHeight);
|
||||
// adjust the offset to be valid
|
||||
if (offset.x < fDataRect.left)
|
||||
offset.x = fDataRect.left;
|
||||
|
||||
Reference in New Issue
Block a user