DomRectReadOnly Class

https://drafts.fxtf.org/geometry/#domrectreadonly

public class DomRectReadOnly

Constructors

NameDescription
DomRectReadOnly(double, double, double, double)Creates a rectangle with the given origin and size.

DomRectReadOnly(double, double, double, double)

DomPoint.cs

Creates a rectangle with the given origin and size.

public DomRectReadOnly(double x = 0d, double y = 0d, double width = 0d, double height = 0d)

Properties

NameDescription
BottomGets the Y coordinate of the bottom edge of the rectangle.
HeightGets the height of the rectangle.
LeftGets the X coordinate of the left edge of the rectangle.
RightGets the X coordinate of the right edge of the rectangle.
TopGets the Y coordinate of the top edge of the rectangle.
WidthGets the width of the rectangle.
XGets the X coordinate of the origin of the rectangle.
YGets the Y coordinate of the origin of the rectangle.

Gets the Y coordinate of the bottom edge of the rectangle.

public double Bottom { get; }

Gets the height of the rectangle.

public double Height { get; }

Gets the X coordinate of the left edge of the rectangle.

public double Left { get; }

Gets the Y coordinate of the top edge of the rectangle.

public double Top { get; }

Gets the width of the rectangle.

public double Width { get; }

Gets the X coordinate of the origin of the rectangle.

public double X { get; }

Gets the Y coordinate of the origin of the rectangle.

public double Y { get; }

Methods

NameDescription
FromRect(DomRectInit?)Creates a read-only rectangle from the origin and size of the given dictionary.
ToJson()Returns a dictionary representation of the rectangle, as used by JSON.stringify().

FromRect(DomRectInit?)

DomPoint.cs

Creates a read-only rectangle from the origin and size of the given dictionary.

public static DomRectReadOnly FromRect(DomRectInit? other = null)

ToJson()

DomPoint.cs

Returns a dictionary representation of the rectangle, as used by JSON.stringify().

public DomRectInit ToJson()