@@ -98,22 +98,23 @@ Rectangle {
98 // move mouse to center
98 // move mouse to center
99 mouseMove(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2);
99 mouseMove(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2);
101+ var oldScale = image.scale;
101 // Test Zoom-in Zoom-out twice.
102 // Test Zoom-in Zoom-out twice.
102 for (var c=0; c<2; c++) {
103 for (var c=0; c<2; c++) {
103 // zoom in
104 // zoom in
104 for (var i=0; i<10; i++) {
105 for (var i=0; i<10; i++) {
105 mouseWheel(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2, 0, 10);
106 mouseWheel(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2, 0, 10);
106− tryCompare(image, "scale", 1.0 + (i + 1) * 0.1);
107+ tryCompare(image, "scale", oldScale + (i + 1) * 0.1);
107− compare(flickable.contentWidth, lazyImage.width * image.scale);
108+ compare(flickable.contentWidth, Math.max(lazyImage.width * image.scale, flickable.width));
108− compare(flickable.contentHeight, lazyImage.height * image.scale);
109+ compare(flickable.contentHeight, Math.max(lazyImage.height * image.scale, flickable.height));
111 // zoom out
112 // zoom out
112 for (var i=0; i<10; i++) {
113 for (var i=0; i<10; i++) {
113 mouseWheel(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2, 0, -10);
114 mouseWheel(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2, 0, -10);
114− tryCompare(image, "scale", 2.0 - (i + 1) * 0.1);
115+ tryCompare(image, "scale", oldScale + 1.0 - (i + 1) * 0.1);
115− compare(flickable.contentWidth, lazyImage.width * image.scale);
116+ compare(flickable.contentWidth, Math.max(lazyImage.width * image.scale, flickable.width));
116− compare(flickable.contentHeight, lazyImage.height * image.scale);
117+ compare(flickable.contentHeight, Math.max(lazyImage.height * image.scale, flickable.height));
@@ -124,15 +125,15 @@ Rectangle {
124 answer1: true,
125 answer1: true,
125 answer2: false,
126 answer2: false,
126 answer3: true,
127 answer3: true,
127− answer4: 1.0,
128+ answer4: 0.5,
128− answer5: 1.0 },
129+ answer5: 0.5 },
129 { source:widgetData2["source"],
130 { source:widgetData2["source"],
130 zoomable:true,
131 zoomable:true,
131 answer1: false,
132 answer1: false,
132 answer2: true,
133 answer2: true,
133 answer3: false,
134 answer3: false,
134− answer4: 1.7740461882048026,
135+ answer4: 0.8870230941024013,
135− answer5: 1.0 }
136+ answer5: 0.5 }
@@ -179,13 +180,15 @@ Rectangle {
179 compare(newScale > oldScale, data.answer2, "scale factor didn't changed");
180 compare(newScale > oldScale, data.answer2, "scale factor didn't changed");
180 compare(signalSpy.count == 0, data.answer3, "scale signal count error");
181 compare(signalSpy.count == 0, data.answer3, "scale signal count error");
181 compare(newScale, data.answer4, "scale factor error");
182 compare(newScale, data.answer4, "scale factor error");
182− compare(flickable.contentWidth, lazyImage.width * image.scale);
183+ compare(flickable.contentWidth, Math.max(lazyImage.width * image.scale, flickable.width));
183− compare(flickable.contentHeight, lazyImage.height * image.scale);
184+ compare(flickable.contentHeight, Math.max(lazyImage.height * image.scale, flickable.height));
185 wait(3000); // have to delay between two consequent pinch event.
186 wait(3000); // have to delay between two consequent pinch event.
186 // pinch zoom-out
187 // pinch zoom-out
187 touchPinch(zoomableImage, x1End, y1End, x1Start, y1Start, x2End, y2End, x2Start, y2Start);
188 touchPinch(zoomableImage, x1End, y1End, x1Start, y1Start, x2End, y2End, x2Start, y2Start);
188 tryCompare(image, "scale", data.answer5);
189 tryCompare(image, "scale", data.answer5);
190+ compare(flickable.contentWidth, Math.max(lazyImage.width * image.scale, flickable.width));
191+ compare(flickable.contentHeight, Math.max(lazyImage.height * image.scale, flickable.height));