summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-03-07 16:04:22 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-03-07 16:04:22 (GMT)
commit936a88c9eb905e336c571e89ad2f7e5db2d5e9a5 (patch)
tree8133be8d8b298bb27aef647486bd76d84e654af6 /examples
parentca83e2df556e4e3db361ffd09696ef6c94d7324e (diff)
parentdda11ee48e323f4f4c6490822aa8921d5d6e3e69 (diff)
downloadQt-936a88c9eb905e336c571e89ad2f7e5db2d5e9a5.zip
Qt-936a88c9eb905e336c571e89ad2f7e5db2d5e9a5.tar.gz
Qt-936a88c9eb905e336c571e89ad2f7e5db2d5e9a5.tar.bz2
Merge branch 4.7 into qt-master-from-4.7
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/touchinteraction/pincharea/flickresize.qml11
1 files changed, 9 insertions, 2 deletions
diff --git a/examples/declarative/touchinteraction/pincharea/flickresize.qml b/examples/declarative/touchinteraction/pincharea/flickresize.qml
index a2f81ff..9439ace 100644
--- a/examples/declarative/touchinteraction/pincharea/flickresize.qml
+++ b/examples/declarative/touchinteraction/pincharea/flickresize.qml
@@ -54,14 +54,21 @@ Rectangle {
PinchArea {
width: Math.max(flick.contentWidth, flick.width)
height: Math.max(flick.contentHeight, flick.height)
+
+ property real initialWidth
+ property real initialHeight
+ onPinchStarted: {
+ initialWidth = flick.contentWidth
+ initialHeight = flick.contentHeight
+ }
+
onPinchUpdated: {
// adjust content pos due to drag
flick.contentX += pinch.previousCenter.x - pinch.center.x
flick.contentY += pinch.previousCenter.y - pinch.center.y
// resize content
- var scale = 1.0 + pinch.scale - pinch.previousScale
- flick.resizeContent(flick.contentWidth * scale, flick.contentHeight * scale, pinch.center)
+ flick.resizeContent(initialWidth * pinch.scale, initialHeight * pinch.scale, pinch.center)
}
onPinchFinished: {