summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorJoona Petrell <joona.t.petrell@nokia.com>2010-04-14 07:15:22 (GMT)
committerJoona Petrell <joona.t.petrell@nokia.com>2010-04-14 07:16:44 (GMT)
commit6ae0b924102384d088c9a7f9b43170cf0d2668bd (patch)
treeb7815430e94da7fc21924e3be548b1c221068983 /src/declarative
parent4492df7ff293a5d76b5021bc60e3ba7d5041c303 (diff)
downloadQt-6ae0b924102384d088c9a7f9b43170cf0d2668bd.zip
Qt-6ae0b924102384d088c9a7f9b43170cf0d2668bd.tar.gz
Qt-6ae0b924102384d088c9a7f9b43170cf0d2668bd.tar.bz2
Image with PreserveAspect enabled with either width or height defined should implicitly update the undefined axis to follow the aspect ratio
Task-number: Reviewed-by: Martin Jones
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
index e4f3464..ca86637 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -311,6 +311,12 @@ void QDeclarativeImage::updatePaintedGeometry()
d->paintedWidth = heightScale * qreal(d->pix.width());
d->paintedHeight = height();
}
+ if (widthValid() && !heightValid()) {
+ setImplicitHeight(d->paintedHeight);
+ }
+ if (heightValid() && !widthValid()) {
+ setImplicitWidth(d->paintedWidth);
+ }
} else {
d->paintedWidth = width();
d->paintedHeight = height();