UNPKG

@daign/2d-graphics

Version:

Two dimensional graphics library that implements the daign-2d-pipeline.

29 lines (28 loc) 1.17 kB
import { Vector2 } from '@daign/math'; import { ControlObject } from '../control-elements'; import { IControlModifier } from './iControlModifier'; /** * Abstract class for a chain of modifiers that restrict or modify the outcome of drawing actions. */ export declare class ControlModifierChain implements IControlModifier { enabled: boolean; private modifiers; selectorFunction: (updatedPoints: Vector2[], pointIndex: number, controlObject: ControlObject) => boolean; /** * Constructor. */ constructor(); /** * Method that applies the chain of modifiers to the point array. * @param updatedPoints - The array of updated points. * @param pointIndex - The index of the point that initiated the change. * @param controlObject - The corresponding control object. * @returns The modified array of points. */ modifyPoints(updatedPoints: Vector2[], pointIndex: number, controlObject: ControlObject): Vector2[]; /** * Add a modifier to the chain of modifiers. Can also be another ModifierChain. * @param modifier - The modifier to add. */ addModifier(modifier: IControlModifier): void; }