TuiBounds
A rectangular region in terminal cell coordinates (`$x`/`$y` from the top-left, in columns/rows), used throughout the TUI layer for viewport, node, and overlay placement.
TuiBounds::__construct()
public function __construct(int $x, int $y, int $width, int $height):Parameters
| Name | Type | Description |
|---|---|---|
| $x | int | |
| $y | int | |
| $width | int | |
| $height | int |
Throws
\InvalidArgumentException If any of `$x`, `$y`, `$width`, `$height` is negative.
TuiBounds::right()
public function right(): intThe x-coordinate just past this region's right edge (`$x + $width`).
TuiBounds::bottom()
public function bottom(): intThe y-coordinate just past this region's bottom edge (`$y + $height`).
TuiBounds::inset()
public function inset(int $amount): selfReturns a new region shrunk by `$amount` on every side (e.g. for padding). `$amount` is clamped to non-negative, and the resulting width/height are clamped to zero rather than going negative when `$amount` exceeds half of this region's size.
Parameters
| Name | Type | Description |
|---|---|---|
| $amount | int |