Instance Method

constrainBoundsRect:

Constrains the bounds of the clip view while the user is magnifying and scrolling.

Declaration

- (NSRect)constrainBoundsRect:(NSRect)proposedBounds;

Parameters

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 constrainScrollPoint: 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.

See Also

Scrolling

- scrollToPoint:

Changes the origin of the clip view’s bounds rectangle to newOrigin.

- autoscroll:

Scrolls the clip view proportionally to theEvent’s distance outside of it.

- constrainScrollPoint:

Returns a scroll point adjusted from the proposed new origin, if necessary, to guarantee the view will lie within its document view.

Deprecated