Skip to main content

BoxConstraints

Constraints that must be respected by a size of a box.

A Size respects a BoxConstraints if, and only if, all of the following relations hold:

min_width <= Size.width <= max_width min_height <= Size.height <= max_height

Read more about BoxConstraints here.

Properties

  • max_height - The maximum height that satisfies the constraints, such that min_height <= max_height <= float("inf").
  • max_width - The maximum width that satisfies the constraints, such that min_width <= max_width <= float("inf").
  • min_height - The minimum height that satisfies the constraints, such that 0.0 <= min_height <= max_height.
  • min_width - The minimum width that satisfies the constraints, such that 0.0 <= min_width <= max_width.

Methods

  • copy - Returns a copy of this object with the specified properties overridden.

Properties

max_heightclass-attributeinstance-attribute

max_height: Number = float('inf')

The maximum height that satisfies the constraints, such that min_height <= max_height <= float("inf").

max_widthclass-attributeinstance-attribute

max_width: Number = float('inf')

The maximum width that satisfies the constraints, such that min_width <= max_width <= float("inf").

min_heightclass-attributeinstance-attribute

min_height: Number = 0

The minimum height that satisfies the constraints, such that 0.0 <= min_height <= max_height.

min_widthclass-attributeinstance-attribute

min_width: Number = 0

The minimum width that satisfies the constraints, such that 0.0 <= min_width <= max_width.

Methods

copy

copy(min_width: Optional[Number] = None, min_height: Optional[Number] = None, max_width: Optional[Number] = None, max_height: Optional[Number] = None)

Returns a copy of this object with the specified properties overridden.