Table of Contents

Class Geometry

Namespace
Ranorex.Core
Assembly
Ranorex.Core.dll

Helper class for geometry related methods.

public static class Geometry
Inheritance
Geometry
Inherited Members

Methods

CalculateEnsureVisibleScrollPixels(Rectangle, Rectangle)

Calculates scroll pixels for EnsureVisible operations.

public static Point CalculateEnsureVisibleScrollPixels(Rectangle container, Rectangle item)

Parameters

container Rectangle

A container rectangle.

item Rectangle

An item rectangle.

Returns

Point

The pixels the containers needs to be scrolled in order to make the item visible.

CalculateEnsureVisibleScrollPixels(Rectangle, Rectangle, bool)

Calculates scroll pixels for EnsureVisible operations.

public static Point CalculateEnsureVisibleScrollPixels(Rectangle container, Rectangle item, bool favorTopLeft)

Parameters

container Rectangle

A container rectangle.

item Rectangle

An item rectangle.

favorTopLeft bool

If set to true, the top-left corner of the item is made visible if the whole item cannot be made visible.

Returns

Point

The pixels the containers needs to be scrolled in order to make the item visible.

CalculateEnsureVisibleScrollPixelsOnScreen(Rectangle)

Calculates scroll pixels for EnsureVisible operations in order to make the item visible on the screen.

public static Point CalculateEnsureVisibleScrollPixelsOnScreen(Rectangle item)

Parameters

item Rectangle

An item rectangle.

Returns

Point

The pixels a container needs to be scrolled in order to make the item visible on the screen. Note that if you move the container of the item (instead of scrolling), you have to subtract the returned point from the current location of the container.

MDist(Point, Point)

Calculates the Manhattan distance between two points.

public static double MDist(Point a, Point b)

Parameters

a Point

First point.

b Point

Second point.

Returns

double

The distance between a and b.

Normalize(Rectangle)

Normalizes the specified rectangle, i.e. ensures that both width and height are positive.

public static Rectangle Normalize(Rectangle rect)

Parameters

rect Rectangle

A rectangle.

Returns

Rectangle

The normalized rectangle, i.e. a rectangle with positive width and height.