constrainBoundsRect(_:)
Constrains the bounds of the clip view while the user is magnifying and scrolling.
Declaration
func constrainBoundsRect(_ proposedBounds: NSRect) -> NSRectParameters
- proposedBounds:
The bounds to use to ensure that the view will still lie within its document view.
Return Value
A bounds rectangle.
Discussion
Note that you can move an implementation of the deprecated constrainScroll(_:) to this method by adjusting the origin of proposedBounds (instead of using the newOrigin parameter in -constrainScrollPoint:). To preserve compatibility, if a subclass overrides -constrainScrollPoint:, the default behavior of constrainBoundsRect(_:) will be to use that -constrainScrollPoint: to adjust the origin of proposedBounds, and to not change the size.