From 51a09036d2c7fdefa82698d5f096efd604f4e364 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 12 Jan 2011 15:08:53 +1000 Subject: Revert "Don't use implicitSize when calculating implicit size" This reverts commit d91eb7728beea99eb347293c89500cfa03814208. Need to consult on the expected behavior before fixing this one. --- src/declarative/graphicsitems/qdeclarativeimage.cpp | 10 ++++------ 1 file 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); -- cgit v0.12