}
else if (viewBox != null)
{
xx = (float)viewBox.x;
ww = (float)viewBox.width;
width = new NumberWithUnits(ww, NumberWithUnits.UT_PX);
x = new NumberWithUnits(xx, NumberWithUnits.UT_PX);
}
else
{
//Estimate size from scene bounding box
xx = (float)defaultBounds.getX();
ww = (float)defaultBounds.getWidth();
width = new NumberWithUnits(ww, NumberWithUnits.UT_PX);
x = new NumberWithUnits(xx, NumberWithUnits.UT_PX);
}
if (height != null)
{
yy = (y == null) ? 0 : StyleAttribute.convertUnitsToPixels(y.getUnits(), y.getValue());
if (height.getUnits() == NumberWithUnits.UT_PERCENT)
{
hh = height.getValue() * deviceViewport.height;
}
else
{
hh = StyleAttribute.convertUnitsToPixels(height.getUnits(), height.getValue());
}
}
else if (viewBox != null)
{
yy = (float)viewBox.y;
hh = (float)viewBox.height;
height = new NumberWithUnits(hh, NumberWithUnits.UT_PX);
y = new NumberWithUnits(yy, NumberWithUnits.UT_PX);
}
else
{
//Estimate size from scene bounding box
yy = (float)defaultBounds.getY();
hh = (float)defaultBounds.getHeight();
height = new NumberWithUnits(hh, NumberWithUnits.UT_PX);
y = new NumberWithUnits(yy, NumberWithUnits.UT_PX);
}
clipRect.setRect(xx, yy, ww, hh);
if (viewBox == null)