Skip to main content

Constraint

Typeinteger
Backlinks16

Horizontal and vertical constraints for the object relative to its parent container. In the horizontal direction, start indicates the left, and end indicates the right. In the vertical direction, start identifies the top, and end identifies the bottom.

Value

enum: the value of this property must be equal to one of the following values:

ValueExplanation
0
Fix the start and end positions.
1
Fix the start position and size.
2
Fix the start position and apply scaling. For example, let the parent container be 300 units wide, and the child object has an x-coordinate of 30 and a width of 120. When the width of the parent container becomes 500, the x-coordinate of the child object remains 30, and the width becomes (120 / (300 - 30)) * (500 - 30) = 208.89.
3
Fix the end position and size.
4
Fix the end position and apply scaling.
5
Scale. For example, let the parent container be 300 units wide, and the child object has an x-coordinate of 30 and a width of 120. When the width of the parent container becomes 500, the x-coordinate of the child object becomes 30 / 300 * 500 = 50, and the width becomes 120 / 300 * 500 = 200.
6
Fix the center proportion and maintain a fixed size. For example, let the parent container be 300 units wide, and the child object has an x-coordinate of 90 and a width of 120. When the width of the parent container becomes 500, the x-coordinate of the child object becomes (90 + 120 / 2) / 300 * 500 - 120 / 2 = 190, and the width remains 120.
7
Keep the centerline distance between the child object and the parent container constant. For example, let the parent container be 300 units wide, and the child object has an x-coordinate of 30 and a width of 120. When the width of the parent container becomes 500, the x-coordinate of the child object becomes 500 / 2 - (300 / 2 - (30 + 120 / 2)) - 120 / 2 = 130, and the width remains 120.