a little more deterministic behaviour: Svg::elementSize(elementId)
returns 0,0 for not existing elements: this fixes also some of the panel funny behaviour svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=803651
This commit is contained in:
parent
c3925a3496
commit
94517b3f87
5
svg.cpp
5
svg.cpp
@ -219,6 +219,11 @@ class Svg::Private
|
||||
QSize elementSize(const QString& elementId)
|
||||
{
|
||||
createRenderer();
|
||||
|
||||
if (!renderer->elementExists(elementId)) {
|
||||
return QSize(0, 0);
|
||||
}
|
||||
|
||||
QSizeF elementSize = renderer->boundsOnElement(elementId).size();
|
||||
QSizeF naturalSize = renderer->defaultSize();
|
||||
qreal dx = size.width() / naturalSize.width();
|
||||
|
Loading…
Reference in New Issue
Block a user