Table of Contents

Struct ClipQuad

Namespace
SixLabors.Fonts
Assembly
SixLabors.Fonts.dll

Represents a rectangular clipping region as a convex quadrilateral. Allows for transformation by rotation, skew, or non-uniform scaling, resulting in non-axis-aligned edges.

public readonly struct ClipQuad
Inherited Members

Constructors

ClipQuad(Vector2, Vector2, Vector2, Vector2)

Initializes a new instance of the ClipQuad struct.

public ClipQuad(Vector2 topLeft, Vector2 topRight, Vector2 bottomRight, Vector2 bottomLeft)

Parameters

topLeft Vector2

The top-left corner of the quadrilateral.

topRight Vector2

The top-right corner of the quadrilateral.

bottomRight Vector2

The bottom-right corner of the quadrilateral.

bottomLeft Vector2

The bottom-left corner of the quadrilateral.

Properties

BottomLeft

Gets the bottom-left corner of the quadrilateral.

public Vector2 BottomLeft { get; }

Property Value

Vector2

BottomRight

Gets the bottom-right corner of the quadrilateral.

public Vector2 BottomRight { get; }

Property Value

Vector2

TopLeft

Gets the top-left corner of the quadrilateral.

public Vector2 TopLeft { get; }

Property Value

Vector2

TopRight

Gets the top-right corner of the quadrilateral.

public Vector2 TopRight { get; }

Property Value

Vector2

Methods

IsAxisAligned(float)

Determines whether the quadrilateral is axis-aligned within a small tolerance.

public bool IsAxisAligned(float tolerance = 0.0001)

Parameters

tolerance float

The tolerance for comparing parallel edges, typically a small epsilon.

Returns

bool

true if opposite edges are parallel and of equal length; otherwise, false.