Skip to main content

HitTestManager

Classes

HitTestManager

Implements

Constructors

Constructor
new HitTestManager(canvas): HitTestManager;
Parameters
ParameterType
canvasCanvas
Returns

HitTestManager

Methods

findItemByHitTest()
findItemByHitTest(point, coordinateSystem?): Item;

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.

Parameters
ParameterTypeDefault valueDescription
pointPointFundefinedthe point.
coordinateSystemCoordinateSystemCoordinateSystem.pagethe coordinate system in which point is defined. If value of the coordinateSystem is not provided then page is used as coordinateSystem.
Returns

Item

Item.

Implementation of

IHitTestManager.findItemByHitTest

getFirstHandlerByHitTest()
getFirstHandlerByHitTest(workspacePoint): BaseRectangleItemHandler;
Parameters
ParameterType
workspacePointPointF
Returns

BaseRectangleItemHandler

getItemHandlersByHitTest()
getItemHandlersByHitTest(point, coordinateSystem?): BaseRectangleItemHandler[];

Returns all item handlers from current container that can be selected and that contain specified point.

Parameters
ParameterTypeDefault valueDescription
pointPointFundefinedthe point.
coordinateSystemCoordinateSystemCoordinateSystem.pagethe coordinate system in which point is defined. If value of the coordinateSystem is not provided then page is used as coordinateSystem.
Returns

BaseRectangleItemHandler[]

array of ItemHandlers.

Implementation of

IHitTestManager.getItemHandlersByHitTest

hitTestSelection()
hitTestSelection(
rect,
workspacePoint,
onlyWidthResizeEnabled?,
tolerance?): IHitTestResult;
Parameters
ParameterTypeDefault value
rectRotatedRectangleFundefined
workspacePointPointFundefined
onlyWidthResizeEnabledbooleanfalse
toleranceanynull
Returns

IHitTestResult

Implementation of

IHitTestManager.hitTestSelection

getDeltaFromSelectionCenterToRotateCenter()
static getDeltaFromSelectionCenterToRotateCenter(
rotationGripSize,
selectionHeight,
selectionWidth,
contentAngle,
mul?): any;

Get delta from selection center to rotate center. Without angle!

Parameters
ParameterTypeDefault value
rotationGripSizenumberundefined
selectionHeightnumberundefined
selectionWidthnumberundefined
contentAnglenumberundefined
mulnumber1
Returns

any

Was this page helpful?