Click or drag to resize
Ranorex

DistanceCalculateFixedDistance Method

Calculates the fixed distance for the specified element rectangle and the given angle.

Namespace:  Ranorex.Core
Assembly:  Ranorex.Core (in Ranorex.Core.dll) Version: 12.7.4-git.38314c06
Syntax
public int CalculateFixedDistance(
	Rectangle elementRectangle,
	GestureDirection angle
)

Parameters

elementRectangle
Type: System.DrawingRectangle
The pixel based rectangle to calculate the fixed distance for.
angle
Type: Ranorex.Core.Recorder.TouchGestureDirection
The angle that determines if width or height will be used for the calculation.

Return Value

Type: Int32
The fixed distance in pixels (rounded).
Remarks
If the distance is already a fixed distance, simply the fixed distance value will be returned. The given element rectangle and the gesture angle will not affect the distance. These will only affect the distance, if the distance is a proportional distance. The function will determine by the given angle if the width or the height of the element rectangle will be used to calculate the distance. The height will be used if 225 < angle <= 315 or 45 < angle <= 135; otherwise the width will be used.
See Also