Skip to content

editor / isValidRectangle

Function: isValidRectangle() ​

isValidRectangle(rectangle): boolean

Defined in: model/is-valid-rectangle.ts:20

Whether a rectangle can enter the model: width and height integers ≥ 0, four corner radii, integers ≥ 0 (ADR-0029), an angle from 0 to 359 and an integer position (ADR-0035).

A size of 0 gives a degenerate rectangle, allowed (Q15); a negative or fractional value is rejected (ADR-0003). A radius larger than the rectangle is valid: it is clamped (ADR-0007).

Parameters ​

rectangle ​

Rectangle

width, height and radii to check

Returns ​

boolean

true when every value is allowed

Kind ​

domain

See ​

docs/domain/shapes.md#rectangle