clear the local cache on resize; prevent ever growing memory usage due to the cache and looking through our applet code people tend to resize rarely, and not between paints
svn path=/trunk/KDE/kdelibs/; revision=891373
This commit is contained in:
parent
ab56a3a388
commit
613383b1ea
17
svg.cpp
17
svg.cpp
@ -442,16 +442,27 @@ void Svg::resize(qreal width, qreal height)
|
|||||||
|
|
||||||
void Svg::resize(const QSizeF &size)
|
void Svg::resize(const QSizeF &size)
|
||||||
{
|
{
|
||||||
|
if (qFuzzyCompare(size, d->size)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
d->size = size;
|
d->size = size;
|
||||||
|
d->localRectCache.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Svg::resize()
|
void Svg::resize()
|
||||||
{
|
{
|
||||||
|
QSizeF newSize;
|
||||||
if (d->renderer) {
|
if (d->renderer) {
|
||||||
d->size = d->renderer->defaultSize();
|
newSize = d->renderer->defaultSize();
|
||||||
} else {
|
|
||||||
d->size = QSizeF();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (qFuzzyCompare(newSize, d->size)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
d->size = newSize;
|
||||||
|
d->localRectCache.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize Svg::elementSize(const QString &elementId) const
|
QSize Svg::elementSize(const QString &elementId) const
|
||||||
|
Loading…
Reference in New Issue
Block a user