<!--
{
  "availability" : [
    "macOS: 10.8.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSScrollView/setMagnification(_:centeredAt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSScrollView(im)setMagnification:centeredAtPoint:"
  },
  "title" : "setMagnification(_:centeredAt:)"
}
-->

# setMagnification(_:centeredAt:)

Magnify the content by the given amount and center the result on the given point.

```
func setMagnification(_ magnification: CGFloat, centeredAt point: NSPoint)
```

## Parameters

`magnification`

The amount by which to magnify the content.

`point`

The point (in content view space) on which to center magnification.

## Discussion

This method scales the content view such that the passed in point (in content view space) remains at the same screen location once the scaling is completed. The resulting magnification value is clipped to the [`minMagnification`](/documentation/AppKit/NSScrollView/minMagnification) and [`maxMagnification`](/documentation/AppKit/NSScrollView/maxMagnification) values. To animate the magnification, use the object’s animator.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)