g.fillRect( 0, 0, width, height );
}
//setImage( theImage, width, height );
if ( diagram != null ) {
SVGRoot root = diagram.getRoot();
if (( oldWidth != width ) || ( oldHeight != height )) {
if ( root != null ) {
root.setAttribute( "width", AnimationElement.AT_XML, Double.toString( width ));
root.setAttribute( "height", AnimationElement.AT_XML, Double.toString( height ));
root.build();
//diagram.setDeviceViewport( new Rectangle( 0,0,width, height));
oldWidth = width;
oldHeight = height;
}
try {
double bbox[] = root.getPresAbsolute( "viewBox" ).getDoubleList();
scaleX = bbox[ 2 ] / width;//root.getPresAbsolute( "width" ).getDoubleValue();
scaleY = bbox[ 3 ] / height;//root.getPresAbsolute( "height" ).getDoubleValue();
} catch ( Exception e ) {}
}