class TermBuf::Damage

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.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(height : Int32) #

[View source]

Instance Method Detail

def clear : Nil #

Marks every row clean.


[View source]
def dirty?(y : Int32) : Bool #

Whether row y has changed.


[View source]
def dirty? : Bool #

Whether anything at all has changed.


[View source]
def each(& : Int32, Range(Int32, Int32) -> ) : Nil #

Yields each dirty row and its changed columns, top to bottom.


[View source]
def height : Int32 #

How many rows are tracked.


[View source]
def resize(height : Int32) : Nil #

Resizes to height rows, discarding any spans: a resize forces a full repaint, so there is nothing worth carrying over.


[View source]
def rows : Int32 #

Number of rows carrying a span.


[View source]
def span(y : Int32) : Range(Int32, Int32) | Nil #

The changed columns of row y, or nil when the row is clean.


[View source]
def touch(x : Int32, y : Int32) : Nil #

Records that the cell at (x, y) changed.


[View source]
def touch_all(width : Int32) : Nil #

Marks every cell of every row as changed.


[View source]
def touch_span(y : Int32, from : Int32, to : Int32) : Nil #

Records that columns from through to of row y changed.


[View source]