---
title: "scaleUnitSquare(to:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsview/scaleunitsquare(to:)"
---

# scaleUnitSquare(to:)

Scales the view’s coordinate system so that the unit square scales to the specified dimensions.

## Declaration

```swift
func scaleUnitSquare(to newUnitSize: NSSize)
```

## Parameters

- `newUnitSize`: An NSSize structure specifying the new unit size.

## Discussion

Discussion For example, a newUnitSize of (0.5, 1.0) causes the view’s horizontal coordinates to be halved, in turn doubling the width of its bounds rectangle. Note that scaling is performed from the origin of the coordinate system, (0.0, 0.0), not the origin of the bounds rectangle; as a result, both the origin and size of the bounds rectangle are changed. The frame rectangle remains unchanged. This method does not redisplay the view or mark it as needing display. You must do this yourself by calling the  display() method or setting the needsDisplay property. This method posts an boundsDidChangeNotification to the default notification center if the view is configured to do so.

## See Also

### Related Documentation

- [setBoundsSize(_:)](appkit/nsview/setboundssize(_:).md)

### Modifying the Coordinate System

- [translateOrigin(to:)](appkit/nsview/translateorigin(to:).md)
- [rotate(byDegrees:)](appkit/nsview/rotate(bydegrees:).md)
