diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2011-01-12 05:08:53 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2011-01-12 05:08:53 (GMT) |
commit | 51a09036d2c7fdefa82698d5f096efd604f4e364 (patch) | |
tree | 4e40a8727835fe7e306e7178a504ef201eb835e8 /src/declarative | |
parent | 9254f161d5b5d95f359f2e9957afdfbe53dc378c (diff) | |
download | Qt-51a09036d2c7fdefa82698d5f096efd604f4e364.zip Qt-51a09036d2c7fdefa82698d5f096efd604f4e364.tar.gz Qt-51a09036d2c7fdefa82698d5f096efd604f4e364.tar.bz2 |
Revert "Don't use implicitSize when calculating implicit size"
This reverts commit d91eb7728beea99eb347293c89500cfa03814208.
Need to consult on the expected behavior before fixing this one.
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeimage.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp index af9fc0b..68a1ecb 100644 --- a/src/declarative/graphicsitems/qdeclarativeimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp @@ -386,16 +386,14 @@ void QDeclarativeImage::updatePaintedGeometry() if (d->fillMode == PreserveAspectFit) { if (!d->pix.width() || !d->pix.height()) return; - int effectiveHeight = heightValid() ? height() : d->pix.height(); - int effectiveWidth = widthValid() ? width() : d->pix.width(); - qreal widthScale = effectiveWidth / qreal(d->pix.width()); - qreal heightScale = effectiveHeight / qreal(d->pix.height()); + qreal widthScale = width() / qreal(d->pix.width()); + qreal heightScale = height() / qreal(d->pix.height()); if (widthScale <= heightScale) { - d->paintedWidth = effectiveWidth; + d->paintedWidth = width(); d->paintedHeight = widthScale * qreal(d->pix.height()); } else if(heightScale < widthScale) { d->paintedWidth = heightScale * qreal(d->pix.width()); - d->paintedHeight = effectiveHeight; + d->paintedHeight = height(); } if (widthValid() && !heightValid()) { setImplicitHeight(d->paintedHeight); |