Skip to content
pixi-silk
GitHub repository
Function

setHandle

import { setHandle } from 'pixi-silk/path';
function setHandle(
   path: BezierPath, 
   index: number, 
   side: HandleSide, 
   offset: Vec | null, 
   breakSymmetry?: boolean
): BezierPath;

Sets one handle of anchor index (an offset from the anchor, or null to remove it). The other handle follows the anchor’s type: a mirrored twin turns opposite with the same length, a smooth one turns opposite and keeps its length. With breakSymmetry the anchor becomes a corner and the twin stays where it is.

Parameters#

ParameterTypeDefault value
pathBezierPathundefined
indexnumberundefined
sideHandleSideundefined
offsetVec | nullundefined
breakSymmetrybooleanfalse

Returns#

BezierPath