Fix elementSize() , elementRect() always returning 0 in Plasma::Svg if called before resize(). Set the size to the document's default size when the renderer is created. Makes it possible to determine the aspect ratio of the graphic.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=706931
This commit is contained in:
parent
b3831c1f44
commit
b329ddb69a
4
svg.cpp
4
svg.cpp
@ -159,6 +159,8 @@ class Svg::Private
|
||||
renderer = new SharedSvgRenderer(path);
|
||||
renderers[path] = renderer;
|
||||
}
|
||||
|
||||
size = renderer->defaultSize();
|
||||
}
|
||||
|
||||
QSize elementSize(const QString& elementId)
|
||||
@ -245,13 +247,13 @@ void Svg::resize( int width, int height )
|
||||
|
||||
void Svg::resize( const QSizeF& size )
|
||||
{
|
||||
d->createRenderer();
|
||||
d->size = size;
|
||||
}
|
||||
|
||||
void Svg::resize()
|
||||
{
|
||||
d->createRenderer();
|
||||
d->size = d->renderer->defaultSize();
|
||||
}
|
||||
|
||||
QSize Svg::elementSize(const QString& elementId) const
|
||||
|
Loading…
Reference in New Issue
Block a user