# `GSLayer indexPathOfNodeAtX:actualPosition:`

*Instance Method*

Returns the index path of an on-curve node near the given x position.

## Declaration

```objc
- (NSIndexPath *) indexPathOfNodeAtX:(CGFloat) X actualPosition:(NSPoint *) pos;
```

```python
indexPathOfNodeAtX_actualPosition_(X: float, pos: NSPoint) -> NSIndexPath
```

## Return Value

The node index path, or `nil` if no matching node or hint position is found.

## Discussion

The actual matched position is written to `pos` when provided.

## See Also

### Node Hit Testing

- [`GSLayer nodeAtPoint:excludeNode:ignoreLocked:tolerance:`](/Core/GlyphsCore/GSLayer/nodeAtPoint:excludeNode:ignoreLocked:tolerance:) — Returns the nearest node to a point, excluding one node.
- [`GSLayer nodeAtPoint:excludeNodes:traverseComponents:ignoreLocked:tolerance:`](/Core/GlyphsCore/GSLayer/nodeAtPoint:excludeNodes:traverseComponents:ignoreLocked:tolerance:) — Returns the nearest node to a point, excluding a set of objects.
- [`GSLayer indexPathOfNodeAtY:actualPosition:`](/Core/GlyphsCore/GSLayer/indexPathOfNodeAtY:actualPosition:) — Returns the index path of an on-curve node near the given y position.

