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

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

BoundsLimiting

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

BoundsLimiting

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

DollyZoom

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

HorizontalLimitPan

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

HorizontalLimitPan

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

HorizontalLimitPan

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

LimitZoom

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

LimitZoom

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

LimitZoom

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

NormaliseScaling

#
Adjust the x and y limits of a rectangle such that the scaling in both directions is consistent.
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ʹ)
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

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