|
|
@ -595,6 +595,10 @@ bool KSVGIconEngine::load(int width, int height, const TQString &path)
|
|
|
|
|
|
|
|
|
|
|
|
// Detect width and height
|
|
|
|
// Detect width and height
|
|
|
|
TQDomElement rootElement = rootNode.toElement();
|
|
|
|
TQDomElement rootElement = rootNode.toElement();
|
|
|
|
|
|
|
|
bool recreatePainter = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Create initial icon painter
|
|
|
|
|
|
|
|
d->painter = new KSVGIconPainter(width, height);
|
|
|
|
|
|
|
|
|
|
|
|
d->width = width; // this sets default for no width -> 100% case
|
|
|
|
d->width = width; // this sets default for no width -> 100% case
|
|
|
|
if(rootElement.hasAttribute("width"))
|
|
|
|
if(rootElement.hasAttribute("width"))
|
|
|
@ -604,6 +608,7 @@ bool KSVGIconEngine::load(int width, int height, const TQString &path)
|
|
|
|
if(!width) // no width set, use default
|
|
|
|
if(!width) // no width set, use default
|
|
|
|
{
|
|
|
|
{
|
|
|
|
width = d->width;
|
|
|
|
width = d->width;
|
|
|
|
|
|
|
|
recreatePainter = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -615,13 +620,16 @@ bool KSVGIconEngine::load(int width, int height, const TQString &path)
|
|
|
|
if(!height) // no height set, use default
|
|
|
|
if(!height) // no height set, use default
|
|
|
|
{
|
|
|
|
{
|
|
|
|
height = d->height;
|
|
|
|
height = d->height;
|
|
|
|
|
|
|
|
recreatePainter = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Create icon painter
|
|
|
|
// Create final icon painter
|
|
|
|
d->painter = new KSVGIconPainter(width, height);
|
|
|
|
if(recreatePainter)
|
|
|
|
|
|
|
|
{
|
|
|
|
// Create icon painter
|
|
|
|
delete d->painter;
|
|
|
|
|
|
|
|
d->painter = new KSVGIconPainter(width, height);
|
|
|
|
|
|
|
|
}
|
|
|
|
d->painter->setDrawWidth(static_cast<int>(d->width));
|
|
|
|
d->painter->setDrawWidth(static_cast<int>(d->width));
|
|
|
|
d->painter->setDrawHeight(static_cast<int>(d->height));
|
|
|
|
d->painter->setDrawHeight(static_cast<int>(d->height));
|
|
|
|
|
|
|
|
|
|
|
|