9 private float _originalZoom;
10 private float _clampedTargetZoom;
17 private protected ZoomEffect(
float targetZoom,
float durationSeconds)
21 throw new ArgumentOutOfRangeException(nameof(targetZoom));
29 internal override EffectChannel Channel => EffectChannel.Zoom;
31 internal override bool SupportsTarget(
object target) => target is
View;
36 var view = GetTarget<View>();
37 _originalZoom = view.Viewport.Zoom;
38 _clampedTargetZoom = Math.Clamp(
TargetZoom, view.MinZoom, view.MaxZoom);
51 GetTarget<View>().Viewport.SnapZoom(_clampedTargetZoom);
55 GetTarget<View>().Viewport.SnapZoom(_originalZoom);
65 : base(targetZoom, durationSeconds)
77 : base(targetZoom, durationSeconds)
float DurationSeconds
Gets the requested effect duration in seconds.
DisplayEffect(float durationSeconds, EasingKind easing=EasingKind.Linear)
Initializes a new instance of the DisplayEffect class.
override void OnStarting()
Captures or prepares target state before the effect starts.
override void ApplyProgress(float progress)
override void RestoreOriginalState()
override void OnCompleted()
Runs the effect-specific completion behavior.
float TargetZoom
Gets the requested final zoom factor.
ZoomEffect(float targetZoom, float durationSeconds)
Initializes a new instance of the ZoomEffect class.
ZoomInEffect(float targetZoom, float durationSeconds)
Creates a zoom-in effect.
ZoomOutEffect(float targetZoom, float durationSeconds)
Creates a zoom-out effect.
Represents a rendered view of a scene, combining a camera position with a viewport configuration to c...
EasingKind
Enumeration of all supported easing functions for animation and movement interpolation....
@ Linear
Linear easing with constant velocity throughout the transition. No acceleration or deceleration is ap...