Instant properties: h

The instant property h represents the height of a rectangle stored within a rect operand.

Declaration

int32 rect.h

Discussion

A rect operand stores the coordinates of a rectangle in its both values point1 and point2, which accordingly represent the rectangle's top-left and bottom-right corners. As such, both corners can be evaluated and adjusted individually.

The instant property h, in contrast, provides a more convenient way to access and modify the rectangle's coordinates. Reading the property results in the height of the rectangle, calculated from the difference between the coordinates of the bottom-right and the top-left corners. In turn, modifying the h property changes the coordinates of the bottom-right corner only, resulting in a rectangle with the new height without changing the rectangle's origin position. For example:

var rect r = <100,200,110,220>; // Read the rectangle height var int32 result = r.h; // result = 20 // Modify the rectangle height r.h = 50; // r = <100,200,110,250>

Usage in Inspector

When working with Inspector you can easily access, evaluate and modify the height of a rectangle. For this purpose select in Inspector the desired rect property or attribute and click on the small triangle on its left side to expand and display the subordinated values: