NodeLayout class

Node layout result.

Uses a standard class because the draw lambda should not participate in equality checks. Caching should be based on the inputs (AST node + context), not the layout itself

Constructors

NodeLayout({required double width, required double height, required double baseline, double italicCorrection = 0.08, required void draw(Canvas canvas, double x, double y)})

Properties

baseline → double
Distance from top to the baseline, always >= 0
final
draw → void Function(Canvas canvas, double x, double y)
Drawing callback. (x, y) are the absolute canvas coordinates of the element's top-left corner
final
hashCode → int
The hash code for this object.
no setterinherited
height → double
Ink bounding box height
final
italicCorrection → double
Italic correction on the right side of the glyph; superscripts retain this, subscripts fallback
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
width → double
Ink bounding box width (includes stroke half-width, italic overhang, etc.)
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

empty → NodeLayout
no setter