Details
-
Suggestion
-
Resolution: Done
-
P1: Critical
-
5.0.0
-
None
-
d95178153a0f15991b2e6e91216dbcf5c0be2af3
Description
Image.sourceSize is not keeping the aspect ratio when setting both width and height. The resulting image is shown as stretched, although setting the fillMode to PreserveAspectCrop.
Example code:
{{
}} import QtQuick 1.0 Item { Image { width: 200 height: 200 fillMode: Image.PreserveAspectCrop source: "http://labs.qt.nokia.com/wp-content/uploads/2011/08/menus.png" sourceSize.width: 300 sourceSize.height: 300 } } {{
}}
Is related to QTBUG-19185
I would like to set sourceSize.usage = SourceCropped to tell the system that the size of the resulting image should preserve aspect ratio and the resulting sourceSize should be so that it either the sourceSize.width is the given width or the sourceSize.height is the given height, which ever results in a larger source image. SourceFitted would result in the smaller source image, although I can't understand, where this could be used...
Currently, if the source image's both width and height are more than the given ones, it is like giving Stretch, and t
Attachments
For Gerrit Dashboard: QTBUG-21161 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
16221,1 | Preserve aspect ratio when setting Image.sourceSize | master | qt/qtdeclarative | Status: MERGED | +2 | 0 |