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