Instance Method
updateViewport(toScale:origin:) updateViewportToScale:origin: updateViewportToScale_origin_
Updates the scale and origin (scroll point) of the viewport (visible part of the frame).
Declaration
func updateViewport(toScale targetScale: CGFloat, origin targetOrigin: NSPoint)Declaration
- (void) updateViewportToScale:(CGFloat) targetScale origin:(NSPoint) targetOrigin;Declaration
updateViewportToScale_origin_(targetScale: float, targetOrigin: NSPoint)Parameters
targetScaleThe desired scale.
CGFLOAT_MAXwhen the scale should not be changed.targetOriginThe desired origin as returned by
-scrollPointFromPoint:toReferencePoint:. Use anxcoordinate ofCGFLOAT_MAXwhen the origin should not be changed.
Discussion
Animates to the new scale and/or origin when enclosed in a NSAnimationContext with implicit animations enabled.
The animation duration will be no longer than the duration of the animation context. However, the effective animation duration might be shorter to compensate for minor visual adjustments.
Existing animations will be modified to retarget the new scale and/or origin.