Canvas class final

Canvas is a cell-buffer that can be used to compose and draw Drawables.

Upstream: third_party/lipgloss/canvas.go (Canvas backed by uv.ScreenBuffer).

Implemented types

Constructors

Canvas(int width, int height)
Creates a canvas with width and height in cells.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

bounds() Rectangle
Returns the drawable bounds of the canvas.
override
cellAt(int x, int y) Cell?
Returns the cell at (x, y) or null if out of bounds.
override
clear() → void
Clears the entire canvas to empty cells.
compose(Drawable drawer) Canvas
Composes a Drawable onto this canvas.
draw(Screen screen, Rectangle area) → void
Draws this canvas onto another Screen within area.
height() int
The current canvas height in cells.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
render() String
Renders the canvas into a string (trimming trailing spaces per line).
resize(int width, int height) → void
Resizes the canvas backing buffer to the given dimensions.
setCell(int x, int y, Cell? cell) → void
Sets the cell at (x, y) in the backing buffer.
override
toString() String
A string representation of this object.
inherited
width() int
The current canvas width in cells.
widthMethod() → WidthMethod
Returns the active grapheme width measurement method.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited