Movement

public static class Movement
Exposes a set of utility methods for implementation panning and zooming navigation within controls. I would have called this Navigation if there hadn't already been a type by that name in Eto...

Methods

BoundsLimiting

#
public static (decimal aʹ, decimal bʹ) BoundsLimiting(RectangleF bounds, float buffer, (decimal a, decimal b) limits, (decimal a, decimal b) initial)
Limits an interval to not exceed (too much) a given limit.
bounds (RectangleF)Bounds within which the motion happens.
buffer (float)The width of the buffer zone in which the limits may be exceeded. Use zero for a tight locking.
limits ((decimal a, decimal b))Limits for either end of the bounds.
initial ((decimal a, decimal b))Initial limits. A=left edge of bounds, B=right edge.
New limits when motion is applied.

BoundsLimiting

#
public static (double aʹ, double bʹ) BoundsLimiting(RectangleF bounds, float buffer, (double a, double b) limits, (double a, double b) initial)
Limits an interval to not exceed (too much) a given limit.
bounds (RectangleF)Bounds within which the motion happens.
buffer (float)The width of the buffer zone in which the limits may be exceeded. Use zero for a tight locking.
limits ((double a, double b))Limits for either end of the bounds.
initial ((double a, double b))Initial limits. A=left edge of bounds, B=right edge.
New limits when motion is applied.

BoundsLimiting

#
public static (float aʹ, float bʹ) BoundsLimiting(RectangleF bounds, float buffer, (float a, float b) limits, (float a, float b) initial)
Limits an interval to not exceed (too much) a given limit.
bounds (RectangleF)Bounds within which the motion happens.
buffer (float)The width of the buffer zone in which the limits may be exceeded. Use zero for a tight locking.
limits ((float a, float b))Limits for either end of the bounds.
initial ((float a, float b))Initial limits. A=left edge of bounds, B=right edge.
New limits when motion is applied.

DollyZoom

#
public static (double x0, double x1, double y0, double y1) DollyZoom(RectangleF bounds, PointF point, float delta, (double x0, double x1, double y0, double y1) initial)
Perform a scroll wheel dolly zoom within a region.
bounds (RectangleF)Region bounds.
point (PointF)Anchor point.
delta (float)Scroll wheel delta.
initial ((double x0, double x1, double y0, double y1))Initial domains visible within region.
New domains visible within region.

HorizontalLimitPan

#
public static (decimal aʹ, decimal bʹ) HorizontalLimitPan(RectangleF bounds, TrackF motion, (decimal a, decimal b) initial)
Perform a horizontal pan for a box limit range.
bounds (RectangleF)Bounds within which the motion happens.
motion (TrackF)Mouse motion for pan.
initial ((decimal a, decimal b))Initial limits. A=left edge of bounds, B=right edge.
New limits when motion is applied.

HorizontalLimitPan

#
public static (double aʹ, double bʹ) HorizontalLimitPan(RectangleF bounds, TrackF motion, (double a, double b) initial)
Perform a horizontal pan for a box limit range.
bounds (RectangleF)Bounds within which the motion happens.
motion (TrackF)Mouse motion for pan.
initial ((double a, double b))Initial limits. A=left edge of bounds, B=right edge.
New limits when motion is applied.

HorizontalLimitPan

#
public static (float aʹ, float bʹ) HorizontalLimitPan(RectangleF bounds, TrackF motion, (float a, float b) initial)
Perform a horizontal pan for a box limit range.
bounds (RectangleF)Bounds within which the motion happens.
motion (TrackF)Mouse motion for pan.
initial ((float a, float b))Initial limits. A=left edge of bounds, B=right edge.
New limits when motion is applied.

LimitZoom

#
public static (decimal aʹ, decimal bʹ) LimitZoom(RectangleF bounds, TrackF motion, (decimal a, decimal b) initial)
Perform a horizontal zoom for a box limit range.
bounds (RectangleF)Bounds within which the motion happens.
motion (TrackF)Mouse motion for pan.
initial ((decimal a, decimal b))Initial limits. A=left edge of bounds, B=right edge.
New limits when zoom is applied.

LimitZoom

#
public static (double aʹ, double bʹ) LimitZoom(RectangleF bounds, TrackF motion, (double a, double b) initial)
Perform a horizontal zoom for a box limit range.
bounds (RectangleF)Bounds within which the motion happens.
motion (TrackF)Mouse motion for pan.
initial ((double a, double b))Initial limits. A=left edge of bounds, B=right edge.
New limits when motion is applied.

LimitZoom

#
public static (float aʹ, float bʹ) LimitZoom(RectangleF bounds, TrackF motion, (float a, float b) initial)
Perform a horizontal zoom for a box limit range.
bounds (RectangleF)Bounds within which the motion happens.
motion (TrackF)Mouse motion for pan.
initial ((float a, float b))Initial limits. A=left edge of bounds, B=right edge.
New limits when motion is applied.

NormaliseScaling

#
public static bool NormaliseScaling(RectangleF frame, double x0, double x1, double y0, double y1, out double x0ʹ, out double x1ʹ, out double y0ʹ, out double y1ʹ)
Adjust the x and y limits of a rectangle such that the scaling in both directions is consistent.
frame (RectangleF)Visible frame.
x0 (double)X value along left edge of frame.
x1 (double)X value along right edge of frame.
y0 (double)Y value along bottom edge of frame.
y1 (double)Y value along top edge of frame.
x0ʹ (out double)Adjusted x value along left edge of frame.
x1ʹ (out double)Adjusted x value along right edge of frame.
y0ʹ (out double)Adjusted y value along bottom edge of frame.
y1ʹ (out double)Adjusted y value along top edge of frame.
True if the limits were adjusted.

Rotate3D

#
public static RotationF Rotate3D(TrackF motion, RotationF initial)
Perform a 3D rotation.
motion (TrackF)
initial (RotationF)