Table of Contents

Method ClampToMinMax

Namespace
Alternet.Drawing
Assembly
Alternet.UI.Common.dll

ClampToMinMax(PointD, PointD)

Clamps the current point's coordinates to the specified minimum and maximum bounds.

public readonly PointD ClampToMinMax(PointD min, PointD max)

Parameters

min PointD

The point representing the minimum allowable values for the coordinates. The X and Y values of this point define the lower bounds.

max PointD

The point representing the maximum allowable values for the coordinates. The X and Y values of this point define the upper bounds.

Returns

PointD

A new PointD instance with its coordinates clamped to the specified bounds.

Remarks

If the current point's coordinates are already within the specified bounds, the returned point will have the same coordinates as the current point.