Skip to main content

Module query

Module query 

Source
Expand description

Shape queries (bounds, hit tests, lengths, trimming, resampling, conversion) built on the renderer’s own geometry code.

Points are normalized as in the model; lengths and distances are in pixels of the given size.

Structs§

Nearest
The point of a path nearest another.

Functions§

from_bez
A pixel path as normalized vertices and tangents. Quadratics are raised to cubics, and a straight closing segment is left implicit.
hit_test
The tree path of the front-most fill or stroke that paints the normalized point.
items
Every item’s ItemPath (place in the tree, device path, and bounds), in document order.
nearest_point
The point of path nearest the normalized point, measured in pixels.
path_lengths
Each subpath’s length in pixels.
resample_path
path resampled to counts[i] evenly spaced vertices on subpath i, so paths with different vertex counts can morph. Tangents are a third of the spacing. Subpaths without a count, or with a count under 2 (3 when closed), are unchanged.
shape_bounds
The normalized bounds of every item in document order, None for items that show nothing. Strokes include their width; trims are not listed.
to_path
geometry converted to a normalized path with the same outline.
trim_path
path trimmed the way a trim item in combined mode trims it.