---
title: "HitTestManager | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/HitTestManager/"
---

# HitTestManager

> - [`IHitTestManager`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/IHitTestManager.md#ihittestmanager)

## Classes

### HitTestManager

#### Implements

#### Constructors

##### Constructor

```ts
new HitTestManager(canvas): HitTestManager;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `canvas` | [`Canvas`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/Canvas-1.md#canvas) |

###### Returns

[`HitTestManager`](#hittestmanager)

#### Methods

##### findItemByHitTest()

```ts
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

| Parameter | Type | Default value | Description |
| ------ | ------ | ------ | ------ |
| `point` | `PointF` | `undefined` | the point. |
| `coordinateSystem` | [`CoordinateSystem`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/CoordinateSystem.md#coordinatesystem) | `CoordinateSystem.page` | the 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`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/IHitTestManager.md#ihittestmanager).[`findItemByHitTest`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/IHitTestManager.md#finditembyhittest)

##### getFirstHandlerByHitTest()

```ts
getFirstHandlerByHitTest(workspacePoint): BaseRectangleItemHandler;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `workspacePoint` | `PointF` |

###### Returns

[`BaseRectangleItemHandler`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/BaseRectangleItemHandler.md#baserectangleitemhandler)

##### getItemHandlersByHitTest()

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

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

###### Parameters

| Parameter | Type | Default value | Description |
| ------ | ------ | ------ | ------ |
| `point` | `PointF` | `undefined` | the point. |
| `coordinateSystem` | [`CoordinateSystem`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/CoordinateSystem.md#coordinatesystem) | `CoordinateSystem.page` | the coordinate system in which point is defined. If value of the coordinateSystem is not provided then page is used as coordinateSystem. |

###### Returns

[`BaseRectangleItemHandler`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/BaseRectangleItemHandler.md#baserectangleitemhandler)[]

array of ItemHandlers.

###### Implementation of

[`IHitTestManager`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/IHitTestManager.md#ihittestmanager).[`getItemHandlersByHitTest`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/IHitTestManager.md#getitemhandlersbyhittest)

##### hitTestSelection()

```ts
hitTestSelection(
   rect, 
   workspacePoint, 
   onlyWidthResizeEnabled?, 
   tolerance?): IHitTestResult;
```

###### Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `rect` | `RotatedRectangleF` | `undefined` |
| `workspacePoint` | `PointF` | `undefined` |
| `onlyWidthResizeEnabled` | `boolean` | `false` |
| `tolerance` | `any` | `null` |

###### Returns

[`IHitTestResult`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/IHitTestResult.md#ihittestresult)

###### Implementation of

[`IHitTestManager`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/IHitTestManager.md#ihittestmanager).[`hitTestSelection`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/IHitTestManager.md#hittestselection)

##### getDeltaFromSelectionCenterToRotateCenter()

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

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

###### Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `rotationGripSize` | `number` | `undefined` |
| `selectionHeight` | `number` | `undefined` |
| `selectionWidth` | `number` | `undefined` |
| `contentAngle` | `number` | `undefined` |
| `mul` | `number` | `1` |

###### Returns

`any`
