UNPKG

@daign/2d-graphics

Version:

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

25 lines (24 loc) 946 B
import { Vector2 } from '@daign/math'; import { ControlObject } from '../control-elements'; import { IControlModifier } from './iControlModifier'; /** * Rounding modifier. * Round the point coordinates to the given precision. */ export declare class RoundingModifier implements IControlModifier { enabled: boolean; private precision; /** * Constructor. * @param precision - The number of decimal places to round to. Optional. */ constructor(precision?: number); /** * Modify the position change that has been requested for a control object. * @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[]; }