summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-03-07 06:20:21 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-03-07 06:20:21 (GMT)
commitdda11ee48e323f4f4c6490822aa8921d5d6e3e69 (patch)
treec9c5ebf1befe8e4747fea809683fba291c08d145
parent57530dab8043c67b1356fb764fc83f6ef00dfdc1 (diff)
parent5ead7e7ddd5430b6a0b5597754f13583b653d67b (diff)
downloadQt-dda11ee48e323f4f4c6490822aa8921d5d6e3e69.zip
Qt-dda11ee48e323f4f4c6490822aa8921d5d6e3e69.tar.gz
Qt-dda11ee48e323f4f4c6490822aa8921d5d6e3e69.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: PinchArea example produced incorrect scaling.
-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: {