# `GSElement hitTest:tolerance:`

*Instance Method*

Whether the element can be selected at a point within a tolerance.

## Declaration

```swift
func hitTest(_ aPoint: NSPoint, tolerance: CGFloat) -> Bool
```

```objc
- (BOOL) hitTest:(NSPoint) aPoint tolerance:(CGFloat) tolerance;
```

```python
hitTest_tolerance_(aPoint: NSPoint, tolerance: float) -> bool
```

## Parameters

- `aPoint` — The point in layer coordinates.
- `tolerance` — The maximum distance from the selectable geometry.

## Discussion

Concrete subclasses define their selectable geometry.

## See Also

### Geometry

- [`GSElement transform:`](/Core/GlyphsCore/GSElement/transform:) — Applies an affine transform to the element geometry.
- [`GSElement getHandleRect:scale:`](/Core/GlyphsCore/GSElement/getHandleRect:scale:) — A handle rectangle centered on a point for an editor scale.

