Import std.term.region
Region
struct
Public Struct Region Implements Hashable, Printable
A rectangle of a screen's cells: its top-left Column and Row, from 0, and its Width and Height.
Examples
Local screen = Region(0, 0, 80, 24)
Local rows = screen.SplitRows(Constraint.Fixed(1), Constraint.Fill(), Constraint.Fixed(1))
Expect(rows[0].Height == 1 && rows[1].Height == 22 && rows[2].Row == 23)
Local columns = rows[1].SplitColumns(Constraint.Percent(25), Constraint.Fill())
Expect(columns[0].Width == 20 && columns[1].Column == 20)-
Its left column, from 0.
-
Its top row, from 0.
-
How many columns wide it is.
-
How many rows high it is.
-
The column just past its right edge, and the row just past its bottom.
-
The row just past its bottom.
-
Whether it has no cells.
-
Whether the cell at
columnandrowis in it. -
It without
margincells on each side, or empty where there aren't that many. -
It without
horizontalcells on its left and right, andverticalones on its top and bottom. -
The cells it has in common with
other, which may be none. -
Its rows, top to bottom, as the
sizessay, each its whole width. -
Its columns, left to right, as the
sizessay, each its whole height. -
Like "(3, 4) 20x10".
Report an issue with this page or with FutureBlitz on GitHub.