if (attrName.equals(SVG_WIDTH_ATTRIBUTE) ||
attrName.equals(SVG_HEIGHT_ATTRIBUTE) ) {
rebuild = true;
} else if (attrName.equals(SVG_X_ATTRIBUTE) ||
attrName.equals(SVG_Y_ATTRIBUTE)) {
SVGDocument doc = (SVGDocument)e.getOwnerDocument();
boolean isOutermost = (doc.getRootElement() == e);
if (!isOutermost) {
// X & Y are ignored on outermost SVG.
float x = 0;
float y = 0;
UnitProcessor.Context uctx;
uctx = UnitProcessor.createContext(ctx, e);
// 'x' attribute - default is 0
String s = e.getAttributeNS(null, SVG_X_ATTRIBUTE);
if (s.length() != 0) {
x = UnitProcessor.svgHorizontalCoordinateToUserSpace
(s, SVG_X_ATTRIBUTE, uctx);
}
// 'y' attribute - default is 0
s = e.getAttributeNS(null, SVG_Y_ATTRIBUTE);
if (s.length() != 0) {
y = UnitProcessor.svgVerticalCoordinateToUserSpace
(s, SVG_Y_ATTRIBUTE, uctx);
}
AffineTransform positionTransform =
AffineTransform.getTranslateInstance(x, y);
CanvasGraphicsNode cgn;
cgn = (CanvasGraphicsNode)node;
cgn.setPositionTransform(positionTransform);
}
} else if (attrName.equals(SVG_VIEW_BOX_ATTRIBUTE) ||
attrName.equals(SVG_PRESERVE_ASPECT_RATIO_ATTRIBUTE)) {
SVGDocument doc = (SVGDocument)e.getOwnerDocument();
boolean isOutermost = (doc.getRootElement() == e);
String s;
UnitProcessor.Context uctx;
uctx = UnitProcessor.createContext(ctx, e);
// X & Y are ignored on outermost SVG.