36
35
anchors.fill: parent
37
contentHeight: image.height
44
property real lastWidth
45
property real lastHeight
46
property double p1toC_X
47
property double p1toC_Y
48
property double contentInitX
49
property double contentInitY
52
lastWidth = image.width
53
lastHeight = image.height
55
contentInitX = flickImg.contentX
56
contentInitY = flickImg.contentY
64
newWidth = lastWidth*pinch.scale;
66
if (newWidth < image.startWidth)
67
newWidth = image.startWidth;
68
else if (newWidth > image.sourceSize.width)
69
newWidth = image.sourceSize.width;
71
flickImg.contentWidth = newWidth;
73
flickImg.contentX = contentInitX-(lastWidth-newWidth)/2
74
flickImg.contentY = contentInitY-(lastHeight-image.height)/2
81
property real startWidth
84
objectName: "imageItem"
88
fillMode: Image.PreserveAspectFit
91
Component.onCompleted: {
92
if (width > sourceSize.width)
93
startWidth = sourceSize.width