class
TermBuf::Damage
- TermBuf::Damage
- Reference
- Object
Overview
Which cells have changed since the last paint, tracked as one column span per row.
A span rather than a per-cell bitmap because the paint loop walks rows
anyway, and rather than a whole-row flag because a status line that changes
three characters should not cost a full row of output. The row count lets
#any? answer without scanning, so a paint with nothing to do is free.
Defined in:
termbuf/core/damage.crConstructors
Instance Method Summary
-
#clear : Nil
Marks every row clean.
-
#dirty?(y : Int32) : Bool
Whether row y has changed.
-
#dirty? : Bool
Whether anything at all has changed.
-
#each(& : Int32, Range(Int32, Int32) -> ) : Nil
Yields each dirty row and its changed columns, top to bottom.
-
#height : Int32
How many rows are tracked.
-
#resize(height : Int32) : Nil
Resizes to height rows, discarding any spans: a resize forces a full repaint, so there is nothing worth carrying over.
-
#rows : Int32
Number of rows carrying a span.
-
#span(y : Int32) : Range(Int32, Int32) | Nil
The changed columns of row y, or
nilwhen the row is clean. -
#touch(x : Int32, y : Int32) : Nil
Records that the cell at (x, y) changed.
-
#touch_all(width : Int32) : Nil
Marks every cell of every row as changed.
-
#touch_span(y : Int32, from : Int32, to : Int32) : Nil
Records that columns from through to of row y changed.
Constructor Detail
Instance Method Detail
Yields each dirty row and its changed columns, top to bottom.
Resizes to height rows, discarding any spans: a resize forces a full repaint, so there is nothing worth carrying over.
The changed columns of row y, or nil when the row is clean.
Records that columns from through to of row y changed.