diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-05-12 01:34:21 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-05-12 01:34:21 (GMT) |
commit | e2cdb5e53e5b6942a0d99c210a9d6fdc56549707 (patch) | |
tree | c87308ce57cfb506fbe8d599a5ff5b954e16a406 /src/declarative/fx/qfxflickable.cpp | |
parent | 415da7f2969bad2765fe535daf9322c7a538da81 (diff) | |
download | Qt-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.cpp | 16 |
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(); } |