correctly resize the svg element
svn path=/trunk/KDE/kdelibs/; revision=1136012
This commit is contained in:
parent
6191e5c9ee
commit
a5dc1e58fd
@ -86,14 +86,16 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//QPainter p(&pm);
|
//QPainter p(&pm);
|
||||||
if (!svgElement.isNull() && svg->hasElement(svgElement)) {
|
|
||||||
QSizeF elementSize = svg->elementSize(svgElement);
|
|
||||||
float scale = pm.width() / qMax(elementSize.width(), elementSize.height());
|
|
||||||
|
|
||||||
svg->resize(svg->size() * scale);
|
if (!svgElement.isEmpty() && svg->hasElement(svgElement)) {
|
||||||
|
svg->resize();
|
||||||
|
QSizeF elementSize = svg->elementSize(svgElement);
|
||||||
|
float scale = q->nativeWidget()->iconSize().width() / qMax(elementSize.width(), elementSize.height());
|
||||||
|
|
||||||
|
svg->resize(elementSize * scale);
|
||||||
pm = svg->pixmap(svgElement);
|
pm = svg->pixmap(svgElement);
|
||||||
} else {
|
} else {
|
||||||
svg->resize(pm.size());
|
svg->resize(q->nativeWidget()->iconSize());
|
||||||
pm = svg->pixmap();
|
pm = svg->pixmap();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user