on xenial help sign in
Fix a small typo in LazyImage: scale -> scaleTo
f702e5dYing-Chun Liu
qml/Components/LazyImage.qml+2−2
@@ -99,10 +99,10 @@ Item {
99 horizontalAlignment: Image.AlignHCenter
99 horizontalAlignment: Image.AlignHCenter
100 verticalAlignment: Image.AlignVCenter
100 verticalAlignment: Image.AlignVCenter
101 sourceSize.width: root.scaleTo == "width" ? root.width
101 sourceSize.width: root.scaleTo == "width" ? root.width
102− : root.scaleTo == "fit" && root.width < root.height ? root.width
102+ : root.scaleTo == "fit" && root.width <= root.height ? root.width
103 : 0
103 : 0
104 sourceSize.height: root.scaleTo == "height" ? root.height
104 sourceSize.height: root.scaleTo == "height" ? root.height
105− : root.scale == "fit" && root.height < root.width ? root.height
105+ : root.scaleTo == "fit" && root.height <= root.width ? root.height
106 : 0
106 : 0
107 }
107 }
108 }
108 }
tests/qmltests/Components/tst_LazyImage.qml+6
@@ -168,6 +168,12 @@ Rectangle {
168 compare(data.image.initialHeight, data.initialHeight);
168 compare(data.image.initialHeight, data.initialHeight);
169 compare(data.image.initialWidth, data.initialWidth);
169 compare(data.image.initialWidth, data.initialWidth);
170
170
171+ // check the sourceSize
172+ var sourceHeight = (data.image.scaleTo === "height" || (data.image.scaleTo === "fit" && data.height <= data.width)) ? data.height : 0
173+ var sourceWidth = (data.image.scaleTo === "width" || (data.image.scaleTo === "fit" && data.width <= data.height)) ? data.width : 0
174+ compare(data.image.sourceSize.height, sourceHeight);
175+ compare(data.image.sourceSize.width, sourceWidth);
176+
171 // check the shape dimensions
177 // check the shape dimensions
172 var shape = findChild(data.image, "shape");
178 var shape = findChild(data.image, "shape");
173 compare(shape.width, data.imageWidth);
179 compare(shape.width, data.imageWidth);