@aurigma/design-atoms
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
56 lines (55 loc) • 2.54 kB
TypeScript
import { RectangleF, PointF, RotatedRectangleF, ILtrb } from "@aurigma/design-atoms-model/Math";
import { Canvas } from "../Canvas";
import { IMoveData } from "./../Services/Selection/ISelectionProcessModifier";
import { ISnapLineData, IAnchor, ISnapElementConfiguration, ISnapLinesHandler } from "./Interfaces";
export declare class SnapLinesHandler implements ISnapLinesHandler {
private _conf;
private _snapData;
private _currentItemRectangle;
constructor(conf?: ISnapLinesConfiguration);
get currentItemRectangle(): RotatedRectangleF;
setConfiguration(conf?: ISnapLinesConfiguration): void;
get configuration(): ISnapLinesConfiguration;
resetActiveLines(): void;
constrainMoveDataToSnapLines(moveData: IMoveData, canvas: Canvas, allowMoveHorizontal: boolean, allowMoveVertical: boolean): PointF;
static SnapResult: {
new (): {
diffValue: number;
activeAnchorIndex: number;
activePointIndex: number;
};
};
private _findSnap;
getVerticalLineData(): ISnapLineData;
getHorizontalLineData(): ISnapLineData;
constrainRectangleToSnapLines(rect: RotatedRectangleF, oldRectWithBorder: RotatedRectangleF, arbitraryResize: boolean, resizeIndex: number, rectWithFramesAndBorder: RotatedRectangleF, rectWithBorder: RotatedRectangleF, canvas: Canvas, border: ILtrb): RotatedRectangleF;
fillSnapData(startRectangle: RotatedRectangleF, startRectangleWithFrames: RotatedRectangleF, startRectangleWithBorder: RectangleF, region: RectangleF, interactiveZonesBounds: RectangleF[], canvas: Canvas, isDrag: boolean): void;
clearSnapData(): void;
private _getSnapLineTolerance;
private get _getDefaultConf();
private get _enabled();
}
export interface ISnapLinesConfiguration {
snapElements: {
items: ISnapItemConfiguration;
printArea: ISnapElementConfiguration;
safetyLines: ISnapElementConfiguration;
region: ISnapElementConfiguration;
grid: ISnapElementConfiguration;
interactiveZones: ISnapElementConfiguration;
};
}
export interface ISnapItemConfiguration extends ISnapElementConfiguration {
includeLocked: boolean;
}
export declare type SnapDataType = {
xAnchors: IAnchor[];
yAnchors: IAnchor[];
defaultBounds: RectangleF;
activeXAnchorIndex: number;
activeYAnchorIndex: number;
xPoints: number[];
yPoints: number[];
activeXPointIndex: number;
activeYPointIndex: number;
};