SvgBounds class

Represents the hit-testable geometry for a parsed SVG region.

Contains the raw Path used for hit testing and the associated InteractiveSelector that identifies the region in the SVG.

Usage notes:

  • path should be in the same coordinate space as the rendered SVG content (i.e. already transformed according to viewBox / fit / alignment).
  • The getVisibleBounds getter returns an axis-aligned bounding rect computed from the visible portion of path (sampling-based approximation).
  • Use contains to perform a fast membership test; it first checks a quick bounding-box containment before invoking the potentially expensive path.contains test.

Constructors

SvgBounds({required Path path, required InteractiveSelector selector})
Create a new SvgBounds for selector backed by path.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
path → Path
The geometric path used for hit testing.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selector → InteractiveSelector
The selector that identifies the SVG region this path corresponds to.
final

Methods

contains(Offset point) → bool
Returns true when point is inside the region represented by this path.
copyWith({Path? path, InteractiveSelector? selector}) → SvgBounds
Creates a copy of this SvgBounds with the provided fields replaced.
getBounds() → Rect
Axis-aligned bounding rectangle that encloses the entire path.
getVisibleBounds() → Rect
Axis-aligned bounding rectangle that encloses the visible points of path.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited