summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-02-08 01:00:47 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-02-08 01:00:47 (GMT)
commit824cecea329f20f6d2c9c3453677cea8f0943434 (patch)
treeeedf294b1e79cd00214dfa9ef1c5a11c07ea9b30 /src/declarative
parent5917d43049020630cb6e79802547a150670304fd (diff)
downloadQt-824cecea329f20f6d2c9c3453677cea8f0943434.zip
Qt-824cecea329f20f6d2c9c3453677cea8f0943434.tar.gz
Qt-824cecea329f20f6d2c9c3453677cea8f0943434.tar.bz2
Make atBeginning/viewArea calculations account for min extent.
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsflickable.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp
index c4edb28..2ff3b30 100644
--- a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp
@@ -119,8 +119,8 @@ void QmlGraphicsFlickableVisibleArea::updateVisible()
// Vertical
const qreal viewheight = flickable->height();
- const qreal maxyextent = -flickable->maxYExtent();
- qreal pagePos = -p->_moveY.value() / (maxyextent + viewheight);
+ const qreal maxyextent = -flickable->maxYExtent() + flickable->minYExtent();
+ qreal pagePos = (-p->_moveY.value() + flickable->minYExtent()) / (maxyextent + viewheight);
qreal pageSize = viewheight / (maxyextent + viewheight);
if (pageSize != m_heightRatio) {
@@ -134,8 +134,8 @@ void QmlGraphicsFlickableVisibleArea::updateVisible()
// Horizontal
const qreal viewwidth = flickable->width();
- const qreal maxxextent = -flickable->maxXExtent();
- pagePos = -p->_moveX.value() / (maxxextent + viewwidth);
+ const qreal maxxextent = -flickable->maxXExtent() + flickable->minXExtent();
+ pagePos = (-p->_moveX.value() + flickable->minXExtent()) / (maxxextent + viewwidth);
pageSize = viewwidth / (maxxextent + viewwidth);
if (pageSize != m_widthRatio) {
@@ -322,7 +322,7 @@ void QmlGraphicsFlickablePrivate::updateBeginningEnd()
// Vertical
const int maxyextent = int(-q->maxYExtent());
const qreal ypos = -_moveY.value();
- bool atBeginning = (ypos <= 0.0);
+ bool atBeginning = (ypos <= -q->minYExtent());
bool atEnd = (maxyextent <= ypos);
if (atBeginning != atYBeginning) {
@@ -337,7 +337,7 @@ void QmlGraphicsFlickablePrivate::updateBeginningEnd()
// Horizontal
const int maxxextent = int(-q->maxXExtent());
const qreal xpos = -_moveX.value();
- atBeginning = (xpos <= 0.0);
+ atBeginning = (xpos <= -q->minXExtent());
atEnd = (maxxextent <= xpos);
if (atBeginning != atXBeginning) {