@ -596,17 +596,31 @@ bool KSVGIconEngine::load(int width, int height, const TQString &path)
// Detect width and height
TQDomElement rootElement = rootNode . toElement ( ) ;
// Create icon painter
d - > painter = new KSVGIconPainter ( width , height ) ;
d - > width = width ; // this sets default for no width -> 100% case
if ( rootElement . hasAttribute ( " width " ) )
{
d - > width = d - > helper - > toPixel ( rootElement . attribute ( " width " ) , true ) ;
if ( ! width ) // no width set, use default
{
width = d - > width ;
}
}
d - > height = height ; // this sets default for no height -> 100% case
if ( rootElement . hasAttribute ( " height " ) )
{
d - > height = d - > helper - > toPixel ( rootElement . attribute ( " height " ) , false ) ;
if ( ! height ) // no height set, use default
{
height = d - > height ;
}
}
// Create icon painter
d - > painter = new KSVGIconPainter ( width , height ) ;
// Create icon painter
d - > painter - > setDrawWidth ( static_cast < int > ( d - > width ) ) ;
d - > painter - > setDrawHeight ( static_cast < int > ( d - > height ) ) ;