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

# translateOrigin(to:)

Translates the view’s coordinate system so that its origin moves to a new location.

## Declaration

```swift
func translateOrigin(to translation: NSPoint)
```

## Parameters

- `translation`: A point that specifies the new origin.

## Discussion

Discussion In the process, the origin of the view’s bounds rectangle is shifted by (–translation.x, –translation.y). This method neither redisplays the view nor marks it as needing display. You must do this yourself by calling the  display() method or setting the needsDisplay property. Note the difference between this method and setting the bounds origin. Translation effectively moves the image inside the bounds rectangle, while setting the bounds origin effectively moves the rectangle over the image. The two are in a sense inverse, although translation is cumulative, and setting the bounds origin is absolute. This method posts an boundsDidChangeNotification to the default notification center if the view is configured to do so.

## See Also

### Related Documentation

- [setBoundsOrigin(_:)](appkit/nsview/setboundsorigin(_:).md)
- [bounds](appkit/nsview/bounds.md)

### Modifying the Coordinate System

- [scaleUnitSquare(to:)](appkit/nsview/scaleunitsquare(to:).md)
- [rotate(byDegrees:)](appkit/nsview/rotate(bydegrees:).md)
