# Struct RRect

- Namespace
- TheArtOfDev.HtmlRenderer.Adapters.Entities

- Assembly
- StockSharp.Xaml.dll

Stores a set of four floating-point numbers that represent the location and size of a rectangle.

`public struct RRect`

- Inherited Members

- Extension Methods

## Constructors

### RRect(double, double, double, double)

Initializes a new instance of the RRect class with the specified location and size.

`public RRect(double x, double y, double width, double height)`

#### Parameters

`x`

doubleThe x-coordinate of the upper-left corner of the rectangle.

`y`

doubleThe y-coordinate of the upper-left corner of the rectangle.

`width`

doubleThe width of the rectangle.

`height`

doubleThe height of the rectangle.

### RRect(RPoint, RSize)

Initializes a new instance of the RRect class with the specified location and size.

`public RRect(RPoint location, RSize size)`

#### Parameters

`location`

RPointA RPoint that represents the upper-left corner of the rectangular region.

`size`

RSizeA RSize that represents the width and height of the rectangular region.

## Fields

### Empty

Represents an instance of the RRect class with its members uninitialized.

`public static readonly RRect Empty`

#### Field Value

## Properties

### Bottom

`public double Bottom { get; }`

#### Property Value

### Height

Gets or sets the height of this RRect structure.

`public double Height { get; set; }`

#### Property Value

### IsEmpty

`public bool IsEmpty { get; }`

#### Property Value

- bool
This property returns true if the Width or Height property of this RRect has a value of zero; otherwise, false.

### Left

Gets the x-coordinate of the left edge of this RRect structure.

`public double Left { get; }`

#### Property Value

### Location

Gets or sets the coordinates of the upper-left corner of this RRect structure.

`public RPoint Location { get; set; }`

#### Property Value

### Right

`public double Right { get; }`

#### Property Value

### Size

Gets or sets the size of this RRect.

`public RSize Size { get; set; }`

#### Property Value

### Top

Gets the y-coordinate of the top edge of this RRect structure.

`public double Top { get; }`

#### Property Value

### Width

Gets or sets the width of this RRect structure.

`public double Width { get; set; }`

#### Property Value

### X

Gets or sets the x-coordinate of the upper-left corner of this RRect structure.

`public double X { get; set; }`

#### Property Value

### Y

Gets or sets the y-coordinate of the upper-left corner of this RRect structure.

`public double Y { get; set; }`

#### Property Value

## Methods

### Contains(double, double)

Determines if the specified point is contained within this RRect structure.

`public bool Contains(double x, double y)`

#### Parameters

#### Returns

- bool
This method returns true if the point defined by

`x`

and`y`

is contained within this RRect structure; otherwise false.

### Contains(RPoint)

Determines if the specified point is contained within this RRect structure.

`public bool Contains(RPoint pt)`

#### Parameters

#### Returns

- bool
This method returns true if the point represented by the

`pt`

parameter is contained within this RRect structure; otherwise false.

### Contains(RRect)

Determines if the rectangular region represented by `rect`

is entirely contained within this
RRect
structure.

`public bool Contains(RRect rect)`

#### Parameters

#### Returns

- bool
This method returns true if the rectangular region represented by

`rect`

is entirely contained within the rectangular region represented by this RRect ; otherwise false.

### Equals(object)

`public override bool Equals(object obj)`

#### Parameters

#### Returns

- bool
This method returns true if

`obj`

is a RRect and its X, Y, Width, and Height properties are equal to the corresponding properties of this RRect; otherwise, false.

### FromLTRB(double, double, double, double)

Creates a RRect structure with upper-left corner and lower-right corner at the specified locations.

`public static RRect FromLTRB(double left, double top, double right, double bottom)`

#### Parameters

`left`

doubleThe x-coordinate of the upper-left corner of the rectangular region.

`top`

doubleThe y-coordinate of the upper-left corner of the rectangular region.

`right`

doubleThe x-coordinate of the lower-right corner of the rectangular region.

`bottom`

doubleThe y-coordinate of the lower-right corner of the rectangular region.

#### Returns

### GetHashCode()

Gets the hash code for this RRect structure. For information about the use of hash codes, see Object.GetHashCode.

`public override int GetHashCode()`

#### Returns

### Inflate(double, double)

Inflates this RRect structure by the specified amount.

`public void Inflate(double x, double y)`

#### Parameters

`x`

doubleThe amount to inflate this RRect structure horizontally.

`y`

doubleThe amount to inflate this RRect structure vertically.

### Inflate(RRect, double, double)

Creates and returns an inflated copy of the specified RRect structure. The copy is inflated by the specified amount. The original rectangle remains unmodified.

`public static RRect Inflate(RRect rect, double x, double y)`

#### Parameters

`rect`

RRectThe RRect to be copied. This rectangle is not modified.

`x`

doubleThe amount to inflate the copy of the rectangle horizontally.

`y`

doubleThe amount to inflate the copy of the rectangle vertically.

#### Returns

### Inflate(RSize)

Inflates this RRect by the specified amount.

`public void Inflate(RSize size)`

#### Parameters

`size`

RSizeThe amount to inflate this rectangle.

### Intersect(RRect)

`public void Intersect(RRect rect)`

#### Parameters

`rect`

RRectThe rectangle to intersect.

### Intersect(RRect, RRect)

Returns a RRect structure that represents the intersection of two rectangles. If there is no intersection, and empty RRect is returned.

`public static RRect Intersect(RRect a, RRect b)`

#### Parameters

#### Returns

- RRect
A third RRect structure the size of which represents the overlapped area of the two specified rectangles.

### IntersectsWith(RRect)

Determines if this rectangle intersects with `rect`

.

`public bool IntersectsWith(RRect rect)`

#### Parameters

`rect`

RRectThe rectangle to test.

#### Returns

- bool
This method returns true if there is any intersection.

### Offset(double, double)

Adjusts the location of this rectangle by the specified amount.

`public void Offset(double x, double y)`

#### Parameters

`x`

doubleThe amount to offset the location horizontally.

`y`

doubleThe amount to offset the location vertically.

### Offset(RPoint)

Adjusts the location of this rectangle by the specified amount.

`public void Offset(RPoint pos)`

#### Parameters

`pos`

RPointThe amount to offset the location.

### ToString()

Converts the Location and Size of this RRect to a human-readable string.

`public override string ToString()`

#### Returns

- string
A string that contains the position, width, and height of this RRect structure for example, "{X=20, Y=20, Width=100, Height=50}".

### Union(RRect, RRect)

Creates the smallest possible third rectangle that can contain both of two rectangles that form a union.

`public static RRect Union(RRect a, RRect b)`

#### Parameters

#### Returns

## Operators

### operator ==(RRect, RRect)

Tests whether two RRect structures have equal location and size.

`public static bool operator ==(RRect left, RRect right)`

#### Parameters

`left`

RRectThe RRect structure that is to the left of the equality operator.

`right`

RRectThe RRect structure that is to the right of the equality operator.

#### Returns

- bool
This operator returns true if the two specified RRect structures have equal X, Y, Width, and Height properties.

### operator !=(RRect, RRect)

Tests whether two RRect structures differ in location or size.

`public static bool operator !=(RRect left, RRect right)`

#### Parameters

`left`

RRectThe RRect structure that is to the left of the inequality operator.

`right`

RRectThe RRect structure that is to the right of the inequality operator.