Rect
Namespace: Hex1b.Layout
Assembly: Hex1b.dll
Represents a rectangle with position and size.
public readonly struct Rect : IEquatable<Rect>Implements
Constructors
Rect(int, int, int, int)
Parameters:
public Rect(int x, int y, int width, int height)Properties
Bottom
Returns: Int32
public int Bottom { get; }Height
Returns: Int32
public int Height { get; }Right
Returns: Int32
public int Right { get; }Size
Returns: Size
public Size Size { get; }Width
Returns: Int32
public int Width { get; }X
Returns: Int32
public int X { get; }Y
Returns: Int32
public int Y { get; }Zero
Returns: Rect
public static Rect Zero { get; }Methods
Contains(int, int)
Checks if a point is inside this rectangle.
Parameters:
Returns: Boolean
True if the point is inside the rectangle, false otherwise.
public bool Contains(int px, int py)Equals(object?)
Indicates whether this instance and a specified object are equal.
Parameters:
obj(Object): The object to compare with the current instance.
Returns: Boolean
true if obj and this instance are the same type and represent the same value; otherwise, false.
public override bool Equals(object? obj)Equals(Rect)
Indicates whether the current object is equal to another object of the same type.
Parameters:
other(Rect): An object to compare with this object.
Returns: Boolean
true if the current object is equal to the other parameter; otherwise, false.
public bool Equals(Rect other)FromSize(Size)
Parameters:
size(Size):
Returns: Rect
public static Rect FromSize(Size size)GetHashCode()
Returns the hash code for this instance.
Returns: Int32
A 32-bit signed integer that is the hash code for this instance.
public override int GetHashCode()ToString()
Returns the fully qualified type name of this instance.
Returns: String
The fully qualified type name.
public override string ToString()Members
operator !=(Rect, Rect)
Parameters:
Returns: Boolean
public static bool operator !=(Rect left, Rect right)operator ==(Rect, Rect)
Parameters:
Returns: Boolean
public static bool operator ==(Rect left, Rect right)