* @param element the image element
*/
protected static Rectangle2D getImageBounds(BridgeContext ctx,
Element element) {
try {
SVGImageElement ie = (SVGImageElement) element;
// 'x' attribute - default is 0
AbstractSVGAnimatedLength _x =
(AbstractSVGAnimatedLength) ie.getX();
float x = _x.getCheckedValue();
// 'y' attribute - default is 0
AbstractSVGAnimatedLength _y =
(AbstractSVGAnimatedLength) ie.getY();
float y = _y.getCheckedValue();
// 'width' attribute - required
AbstractSVGAnimatedLength _width =
(AbstractSVGAnimatedLength) ie.getWidth();
float w = _width.getCheckedValue();
// 'height' attribute - required
AbstractSVGAnimatedLength _height =
(AbstractSVGAnimatedLength) ie.getHeight();
float h = _height.getCheckedValue();
return new Rectangle2D.Float(x, y, w, h);
} catch (LiveAttributeException ex) {
throw new BridgeException(ctx, ex);