Interface ISvgNode2
interface ISvgNode2
Extends ISvgNode
This interface extends ISvgNode with additional functionality to
query the bounding box of an SVG node.
Methods
getObjectBoundingBox()
com.amazon.kepler.uitoolkit.graphics.Rect getObjectBoundingBox()
Computes the object bounding box of this SVG node.
The object bounding box is the smallest axis-aligned rectangle enclosing
this node’s geometry in its local coordinate space, excluding any
transforms applied via ISvgNode::setTransform.
The result depends on the SVG element type:
-
Shape elements (
ISvgRect,ISvgCircle,ISvgEllipse): the resolved geometry bounds. A shape with zero-sized geometry (e.g. a circle with radius 0) returns a zero-width, zero-height rectangle at the element’s resolved position. -
Path (
ISvgPathNode), Polygon, and Polyline elements: the axis-aligned bounds of the path data. -
Image elements (
ISvgImage): the bounding box based on the resolved x, y, width, and height. -
Use elements (
ISvgUse): the bounding box of the referenced element. -
Container elements (
ISvgG,ISvgView): the union of all children’s bounding boxes. -
All other elements (
ISvgTextContainer,ISvgLine,ISvgMask, ClipPath, Defs, gradients, etc.): an empty rectangle {0, 0, 0, 0}.
ISvgView::setContainerSize. If no such ancestor exists
and this node uses percentage-valued attributes, an empty rectangle is
returned since there is no reference to resolve against.
Returns
com.amazon.kepler.uitoolkit.graphics.Rect
Rect the computed object bounding box in
density-independent pixels (DIP).

