PathMetric class

Utilities for measuring a Path and extracting sub-paths.

Iterate over the object returned by Path.computeMetrics to obtain PathMetric objects.

Once created, the methods on this class will only be valid while the iterator is at the contour for which they were created. It will also only be valid for the path as it was specified when Path.computeMetrics was called. If additional contours are added or any contours are updated, the metrics need to be recomputed. Previously created metrics will still refer to a snapshot of the path at the time they were computed, rather than to the actual metrics for the new mutations to the path.

Properties

contourIndex int
The zero-based index of the contour. [...]
final
isClosed bool
Whether the contour is closed. [...]
final
length double
Return the total length of the current contour.
final
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

extractPath(double start, double end, { bool startWithMoveTo: true }) Path
Given a start and stop distance, return the intervening segment(s). [...]
getTangentForOffset(double distance) Tangent
Computes the position of the current contour at the given offset, and the angle of the path at that point. [...]
toString() String
Returns a string representation of this object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited