Skip to content

Rect ​

Namespace: Hex1b.Layout

Assembly: Hex1b.dll

Represents a rectangle with position and size.

csharp
public readonly struct Rect : IEquatable<Rect>

Implements ​

Constructors ​

Rect(int, int, int, int) ​

Parameters:

csharp
public Rect(int x, int y, int width, int height)

Properties ​

Bottom ​

Returns: Int32

csharp
public int Bottom { get; }

Height ​

Returns: Int32

csharp
public int Height { get; }

Returns: Int32

csharp
public int Right { get; }

Size ​

Returns: Size

csharp
public Size Size { get; }

Width ​

Returns: Int32

csharp
public int Width { get; }

X ​

Returns: Int32

csharp
public int X { get; }

Y ​

Returns: Int32

csharp
public int Y { get; }

Zero ​

Returns: Rect

csharp
public static Rect Zero { get; }

Methods ​

Contains(int, int) ​

Checks if a point is inside this rectangle.

Parameters:

  • px (Int32): The X coordinate of the point.
  • py (Int32): The Y coordinate of the point.

Returns: Boolean

True if the point is inside the rectangle, false otherwise.

csharp
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.

csharp
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.

csharp
public bool Equals(Rect other)

FromSize(Size) ​

Parameters:

Returns: Rect

csharp
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.

csharp
public override int GetHashCode()

ToString() ​

Returns the fully qualified type name of this instance.

Returns: String

The fully qualified type name.

csharp
public override string ToString()

Members ​

operator !=(Rect, Rect) ​

Parameters:

Returns: Boolean

csharp
public static bool operator !=(Rect left, Rect right)

operator ==(Rect, Rect) ​

Parameters:

Returns: Boolean

csharp
public static bool operator ==(Rect left, Rect right)

Released under the MIT License.