Click or drag to resize

RectangleRestrict Method (Rectangle, Size)

Restricts the rectangle to be within the specified size

Namespace:  Eto.Drawing
Assembly:  Eto (in Eto.dll) Version: 2.5.3-dev
Syntax
public static Rectangle Restrict(
	Rectangle rectangle,
	Size size
)

Parameters

rectangle
Type: Eto.DrawingRectangle
Rectangle to restrict
size
Type: Eto.DrawingSize
Size to restrict to

Return Value

Type: Rectangle
A new rectangle restricted to the restrict bounds
Remarks
This ensures that rectangle's bounds fall within the bounds of the specified size It is useful to ensure that the rectangle does not exceed certain limits (e.g. for drawing)
See Also