# `GSLayer boundsOfSelection`

*Instance Method*

The bounds of the current selection.

## Declaration

```swift
func boundsOfSelection() -> NSRect
```

```objc
- (NSRect) boundsOfSelection;
```

```python
boundsOfSelection() -> NSRect
```

## Discussion

The bounds include selected paths, components, anchors, and nodes when they belong to the layer.

Returns `CGRectNull` when the selection is empty or cannot be represented by bounds.

## See Also

### Bounds

- [`GSLayer bounds`](/Core/GlyphsCore/GSLayer/bounds) — The drawable bounds of the layer.
- [`GSLayer fastBounds`](/Core/GlyphsCore/GSLayer/fastBounds) — The overestimated bounds of the layer’s shapes.
- [`GSLayer.minX`](/Core/GlyphsCore/GSLayer/minX) — Left edge of [`GSLayer bounds`](/Core/GlyphsCore/GSLayer/bounds).
- [`GSLayer.minY`](/Core/GlyphsCore/GSLayer/minY) — Bottom edge of [`GSLayer bounds`](/Core/GlyphsCore/GSLayer/bounds).
- [`GSLayer.maxX`](/Core/GlyphsCore/GSLayer/maxX) — Right edge of [`GSLayer bounds`](/Core/GlyphsCore/GSLayer/bounds).
- [`GSLayer.maxY`](/Core/GlyphsCore/GSLayer/maxY) — Top edge of [`GSLayer bounds`](/Core/GlyphsCore/GSLayer/bounds).
- [`GSLayer boundsTransform:`](/Core/GlyphsCore/GSLayer/boundsTransform:) — The drawable bounds of the layer after applying a transform.
- [`GSLayer boundsAngle:`](/Core/GlyphsCore/GSLayer/boundsAngle:) — The drawable bounds of the layer after applying a transform.
- [`GSLayer boundsOfSelectionAngle:`](/Core/GlyphsCore/GSLayer/boundsOfSelectionAngle:) — The bounds of the current selection after applying a transform.

