diff options
author | David Boddie <david.boddie@nokia.com> | 2011-03-09 10:46:04 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2011-03-09 10:46:04 (GMT) |
commit | de4954fd676c3bbf15abb9bedad4d09adc1c31b4 (patch) | |
tree | b2ce67c3a485ff5201785f32df6a6105bf25f745 /examples | |
parent | fc954a91625d172ef2dff4b5f9ea615551cb09bf (diff) | |
parent | dc6b5702e0c488bf51ca029290eb65604bfb1dd5 (diff) | |
download | Qt-de4954fd676c3bbf15abb9bedad4d09adc1c31b4.zip Qt-de4954fd676c3bbf15abb9bedad4d09adc1c31b4.tar.gz Qt-de4954fd676c3bbf15abb9bedad4d09adc1c31b4.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into 4.7
Conflicts:
doc/src/declarative/dynamicobjects.qdoc
doc/src/declarative/elements.qdoc
Diffstat (limited to 'examples')
-rw-r--r-- | examples/declarative/touchinteraction/pincharea/flickresize.qml | 11 |
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: { |