diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-03-17 17:10:56 +1000 |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2011-03-17 17:17:43 +1000 |
commit | 695a39410c8ce186a2ce78cef51093c55fc32643 (patch) | |
tree | b33d7c5f1f0e24b1180fcbdb989a47e38f825868 /src/declarative/graphicsitems/qdeclarativeimagebase.cpp | |
parent | cb0b93e3ef107b8a47445c926753b6bcf07b796d (diff) | |
download | qt4-tools-695a39410c8ce186a2ce78cef51093c55fc32643.tar.gz |
Image.PreserveAspectFit has unexpected effect on Image's sourceSize
The sourceSize should always be the size of the image, unless set
otherwise. When calculating the size of an image with
Image.PreserveAspectFit set the natural image size should be used
for the calculation if no size has been set explicitly.
Change-Id: I104b7d1c3c16aa5b4fc98b1f9078ed8ae997cf69
Task-number: QTBUG-16389
Reviewed-by: Joona Petrell
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeimagebase.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeimagebase.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp index 471c87f98c..2de3ba0357 100644 --- a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp @@ -130,7 +130,7 @@ QSize QDeclarativeImageBase::sourceSize() const int width = d->sourcesize.width(); int height = d->sourcesize.height(); - return QSize(width != -1 ? width : implicitWidth(), height != -1 ? height : implicitHeight()); + return QSize(width != -1 ? width : d->pix.width(), height != -1 ? height : d->pix.height()); } bool QDeclarativeImageBase::cache() const |