@aurigma/design-atoms
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
27 lines (26 loc) • 1.61 kB
TypeScript
import { PointF, RotatedRectangleF } from "@aurigma/design-atoms-model/Math";
import { Item } from "@aurigma/design-atoms-model/Product/Items/Item";
import { CoordinateSystem } from "../CoordinateSystem";
import { BaseRectangleItemHandler } from "../../ItemHandlers/BaseRectangleItemHandler";
import { IHitTestResult } from "../../Services";
export interface IHitTestManager {
/**
* Returns all item handlers from current container that can be selected and that contain specified point.
* @param point the point.
* @param coordinateSystem the coordinate system in which point is defined. If value of the coordinateSystem is not
* provided then page is used as coordinateSystem.
* @returns array of ItemHandlers.
*/
getItemHandlersByHitTest(point: PointF, coordinateSystem?: CoordinateSystem): BaseRectangleItemHandler[];
/**
* Returns item from current container that contains specified point. If more than one item matches the point, then
* this method returns first selected item, if any. If there is no selected item, this method returns first item by
* the z order.
* @param point the point.
* @param coordinateSystem the coordinate system in which point is defined. If value of the coordinateSystem is not
* provided then page is used as coordinateSystem.
* @returns Item.
*/
findItemByHitTest(point: PointF, coordinateSystem?: CoordinateSystem): Item;
hitTestSelection(rect: RotatedRectangleF, workspacePoint: PointF, onlyWidthResizeEnabled?: boolean, tolerance?: number): IHitTestResult;
}