Skip to content
pixi-silk
GitHub repository
Type

PathHit

import type { PathHit } from 'pixi-silk/ui/pathgizmo';
type PathHit = 
  | {
  index: number;
  kind: "anchor";
}
  | {
  index: number;
  kind: "handle";
  side: HandleSide;
}
  | {
  kind: "segment";
  segment: number;
  t: number;
  x: number;
  y: number;
};

A part of the path under the pointer. index is an anchor index. A segment hit has the curve parameter t (0 to 1) and the nearest point (x, y) in path coordinates.