C# Class QualityBot.Util.RectangleUtil

Mostrar archivo Open project: Ancestry/quality-bot

Public Methods

Method Description
AllZeroes ( Rectangle rectangle ) : bool

Returns true if the x, y, width, and height of the rectangle are zero.

AreaChange ( Rectangle r1, Rectangle r2 ) : decimal

Determines the area change from the first rectangle to the second.

AreaChangeAsPercent ( Rectangle r1, Rectangle r2 ) : decimal

Determines the area change from the first rectangle to the second.

AreaDifferenceBetweenRectangles ( Rectangle r1, Rectangle r2 ) : long

Calculates the area difference between two rectangles.

ChildrenAndIntersectingSiblings ( Rectangle rectangle, IEnumerable rectangles ) : IEnumerable

Returns all rectangles that intersect with the target rectangle.

DistanceBetweenRectangles ( Rectangle r1, Rectangle r2 ) : decimal

Calculates the distance between two rectangles.

PositiveDimensions ( Rectangle rectangle ) : bool

Returns true if the width and height of the rectangle are greater than zero.

PositiveOrZeroCoordinates ( Rectangle rectangle ) : bool

Returns true if the x and y of the rectangle are greater than or equal to zero.

Method Details

AllZeroes() public static method

Returns true if the x, y, width, and height of the rectangle are zero.
public static AllZeroes ( Rectangle rectangle ) : bool
rectangle System.Drawing.Rectangle The rectangle.
return bool

AreaChange() public static method

Determines the area change from the first rectangle to the second.
public static AreaChange ( Rectangle r1, Rectangle r2 ) : decimal
r1 System.Drawing.Rectangle The first rectangle.
r2 System.Drawing.Rectangle The second rectangle.
return decimal

AreaChangeAsPercent() public static method

Determines the area change from the first rectangle to the second.
public static AreaChangeAsPercent ( Rectangle r1, Rectangle r2 ) : decimal
r1 System.Drawing.Rectangle The first rectangle.
r2 System.Drawing.Rectangle The second rectangle.
return decimal

AreaDifferenceBetweenRectangles() public static method

Calculates the area difference between two rectangles.
public static AreaDifferenceBetweenRectangles ( Rectangle r1, Rectangle r2 ) : long
r1 System.Drawing.Rectangle The first rectangle.
r2 System.Drawing.Rectangle The second rectangle.
return long

ChildrenAndIntersectingSiblings() public static method

Returns all rectangles that intersect with the target rectangle.
public static ChildrenAndIntersectingSiblings ( Rectangle rectangle, IEnumerable rectangles ) : IEnumerable
rectangle System.Drawing.Rectangle The target rectangle.
rectangles IEnumerable The candidate rectangles.
return IEnumerable

DistanceBetweenRectangles() public static method

Calculates the distance between two rectangles.
public static DistanceBetweenRectangles ( Rectangle r1, Rectangle r2 ) : decimal
r1 System.Drawing.Rectangle The first rectangle.
r2 System.Drawing.Rectangle The second rectangle.
return decimal

PositiveDimensions() public static method

Returns true if the width and height of the rectangle are greater than zero.
public static PositiveDimensions ( Rectangle rectangle ) : bool
rectangle System.Drawing.Rectangle The rectangle.
return bool

PositiveOrZeroCoordinates() public static method

Returns true if the x and y of the rectangle are greater than or equal to zero.
public static PositiveOrZeroCoordinates ( Rectangle rectangle ) : bool
rectangle System.Drawing.Rectangle The rectangle.
return bool