ensure that resize() resize always to the natural size (cached, so we

don't create unnecessary renderers)

svn path=/trunk/KDE/kdelibs/; revision=912093
This commit is contained in:
Marco Martin 2009-01-16 17:41:49 +00:00
parent f5c70115db
commit ab3501872d

13
svg.cpp
View File

@ -475,17 +475,18 @@ void Svg::resize(const QSizeF &size)
void Svg::resize()
{
QSizeF newSize;
if (d->renderer) {
newSize = d->renderer->defaultSize();
if (d->naturalSize.isEmpty()) {
d->createRenderer();
d->naturalSize = d->renderer->defaultSize();
}
if (qFuzzyCompare(newSize.width(), d->size.width()) &&
qFuzzyCompare(newSize.height(), d->size.height())) {
if (qFuzzyCompare(d->naturalSize.width(), d->size.width()) &&
qFuzzyCompare(d->naturalSize.height(), d->size.height())) {
return;
}
d->size = newSize;
d->size = d->naturalSize;
d->localRectCache.clear();
}