Perform a hit test on the items contained within the project at the
location of the specified point.
The optional options object allows you to control the specifics of the
hit test and may contain a combination of the following values:
options.tolerance: Number - The tolerance of the hit test
in points.
options.type: Only hit test again a certain item
type: PathItem, Raster, TextItem, etc.
options.fill: Boolean - Hit test the fill of items.
options.stroke: Boolean - Hit test the curves of path
items, taking into account stroke width.
options.segments: Boolean - Hit test for
segment.point of Path items.
options.handles: Boolean - Hit test for the handles
(segment.handleIn / segment.handleOut) of path segments.
options.ends: Boolean - Only hit test for the first or
last segment points of open path items.
options.bounds: Boolean - Hit test the corners and
side-centers of the bounding rectangle of items (item.bounds).
options.center: Boolean - Hit test the
rectangle.center of the bounding rectangle of items
(item.bounds).
options.guide: Boolean - Hit test items that have
item.guide set to true.
options.selected: Boolean - Only hit selected items.
Parameters:
-
point:
Point
— The point where the hit test should be performed
-
options:
Object
— optional, default: { fill: true, stroke: true, segments: true,
tolerance: true }
Returns:
-
HitResult — A hit result object that contains more
information about what exactly was hit or null if nothing was
hit.