Skip to content
pixi-silk
GitHub repository
Type

GuideSnap

import type { GuideSnap } from 'pixi-silk/ui/guides';
type GuideSnap = (axis: "x" | "y", at: number, threshold: number) => number;

Snaps a guide while it is dragged. Gets the raw position and the snap distance, both in world units, and returns where the guide should go. Return at unchanged to let rounding apply.

Parameters#

ParameterType
axis"x" | "y"
atnumber
thresholdnumber

Returns#

number