textual.geometry
Functions and classes to manage terminal geometry (anything involving coordinates or dimensions).
NULL_OFFSET
module-attribute
¶
An [offset][textual.geometry.Offset] constant for (0, 0).
NULL_REGION
module-attribute
¶
A [Region][textual.geometry.Region] constant for a null region (at the origin, with both width and height set to zero).
NULL_SIZE
module-attribute
¶
A [Size][textual.geometry.Size] constant for a null size (with zero area).
NULL_SPACING
module-attribute
¶
A [Spacing][textual.geometry.Spacing] constant for no space.
SpacingDimensions
module-attribute
¶
The valid ways in which you can specify spacing.
clamp
¶
Restrict a value to a given range.
If value
is less than the minimum, return the minimum.
If value
is greater than the maximum, return the maximum.
Otherwise, return value
.
The minimum
and maximum
arguments values may be given in reverse order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
T
|
A value. |
required |
|
T
|
Minimum value. |
required |
|
T
|
Maximum value. |
required |
Returns:
Type | Description |
---|---|
T
|
New value that is not less than the minimum or greater than the maximum. |