From b69827d9b5957cabc70f020c828a544f680789b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 21 Jun 2007 22:14:44 +0000 Subject: [PATCH] * 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 --- src/apps/icon-o-matic/generic/gui/scrollview/ScrollView.cpp | 4 ++-- src/apps/icon-o-matic/generic/gui/scrollview/Scrollable.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apps/icon-o-matic/generic/gui/scrollview/ScrollView.cpp b/src/apps/icon-o-matic/generic/gui/scrollview/ScrollView.cpp index 81966a6d66..80ae49d93f 100644 --- a/src/apps/icon-o-matic/generic/gui/scrollview/ScrollView.cpp +++ b/src/apps/icon-o-matic/generic/gui/scrollview/ScrollView.cpp @@ -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); diff --git a/src/apps/icon-o-matic/generic/gui/scrollview/Scrollable.cpp b/src/apps/icon-o-matic/generic/gui/scrollview/Scrollable.cpp index ae20cbc351..82fbb17b5c 100644 --- a/src/apps/icon-o-matic/generic/gui/scrollview/Scrollable.cpp +++ b/src/apps/icon-o-matic/generic/gui/scrollview/Scrollable.cpp @@ -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;