Skip to main content

resizeWithoutConstraints

Resizes the node. Children of the node are never resized, even if those children have constraints. If the parent has auto-layout, causes the parent to be resized (this constraint cannot be ignored).

Signature

resizeWithoutConstraints(width: number, height: number): void

Parameters

width

New width of the node. Must be >= 0.01

height

New height of the node. Must be >= 0.01, except for LineNode which must always be given a height of exactly 0.

Remarks

This function will not cause its children to resize. Use resize if you need to apply constraints.

caution

⚠️ If this node is a text node with a missing font, the text node will be resized but the text will not re-layout until the next time the text node is opened on a machine that has the font. This can cause the text node to re-layout immediately and be surprising to your user. Consider checking the text node property hasMissingFont before using this function.