Skip to content
pixi-silk
GitHub repository
Function

setAnchorType

import { setAnchorType } from 'pixi-silk/path';
function setAnchorType(
   path: BezierPath, 
   index: number, 
   type: AnchorType, 
   straighten?: boolean
): BezierPath;

Changes anchor index to type. To corner the handles are kept as they are (pass straighten to drop them). To smooth or mirrored they line up, and an anchor without handles gets them from its neighbours.

Parameters#

ParameterTypeDefault value
pathBezierPathundefined
indexnumberundefined
typeAnchorTypeundefined
straightenbooleanfalse

Returns#

BezierPath