summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfxflickable.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-05-12 01:34:21 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-05-12 01:34:21 (GMT)
commite2cdb5e53e5b6942a0d99c210a9d6fdc56549707 (patch)
treec87308ce57cfb506fbe8d599a5ff5b954e16a406 /src/declarative/fx/qfxflickable.cpp
parent415da7f2969bad2765fe535daf9322c7a538da81 (diff)
downloadQt-e2cdb5e53e5b6942a0d99c210a9d6fdc56549707.zip
Qt-e2cdb5e53e5b6942a0d99c210a9d6fdc56549707.tar.gz
Qt-e2cdb5e53e5b6942a0d99c210a9d6fdc56549707.tar.bz2
Make scaling in flickr demo sensible.
Diffstat (limited to 'src/declarative/fx/qfxflickable.cpp')
-rw-r--r--src/declarative/fx/qfxflickable.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/declarative/fx/qfxflickable.cpp b/src/declarative/fx/qfxflickable.cpp
index 4ace811..4248ebb 100644
--- a/src/declarative/fx/qfxflickable.cpp
+++ b/src/declarative/fx/qfxflickable.cpp
@@ -916,6 +916,14 @@ void QFxFlickable::setViewportWidth(int w)
d->_flick->setWidth(width());
else
d->_flick->setWidth(w);
+ // Make sure that we're entirely in view.
+ if (d->_moveX.value() > minXExtent() || maxXExtent() > 0) {
+ d->_tl.clear();
+ d->_moveX.setValue(minXExtent());
+ } else if (d->_moveX.value() < maxXExtent()) {
+ d->_tl.clear();
+ d->_moveX.setValue(maxXExtent());
+ }
emit viewportWidthChanged();
d->updateBeginningEnd();
}
@@ -960,6 +968,14 @@ void QFxFlickable::setViewportHeight(int h)
d->_flick->setHeight(height());
else
d->_flick->setHeight(h);
+ // Make sure that we're entirely in view.
+ if (d->_moveY.value() > minYExtent() || maxYExtent() > 0) {
+ d->_tl.clear();
+ d->_moveY.setValue(minYExtent());
+ } else if (d->_moveY.value() < maxYExtent()) {
+ d->_tl.clear();
+ d->_moveY.setValue(maxYExtent());
+ }
emit viewportHeightChanged();
d->updateBeginningEnd();
}