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:
parent
f5c70115db
commit
ab3501872d
13
svg.cpp
13
svg.cpp
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user