Struct tui_realm_stdlib::Canvas
source · pub struct Canvas { /* private fields */ }Expand description
Canvas
The Canvas widget may be used to draw more detailed figures using braille patterns (each cell can have a braille character in 8 different positions).
Implementations§
source§impl Canvas
impl Canvas
pub fn foreground(self, fg: Color) -> Self
pub fn background(self, bg: Color) -> Self
pub fn borders(self, b: Borders) -> Self
pub fn title<S: AsRef<str>>(self, t: S, a: Alignment) -> Self
pub fn data(self, data: &[Shape]) -> Self
sourcepub fn x_bounds(self, bounds: (f64, f64)) -> Self
pub fn x_bounds(self, bounds: (f64, f64)) -> Self
From https://github.com/fdehau/tui-rs/issues/286:
Those are used to define the viewport of the canvas. Only the points whose coordinates are within the viewport are displayed. When you render the canvas using Frame::render_widget, you give an area to draw the widget to (a Rect) and the crate translates the floating point coordinates to those used by our internal terminal representation.
sourcepub fn y_bounds(self, bounds: (f64, f64)) -> Self
pub fn y_bounds(self, bounds: (f64, f64)) -> Self
From https://github.com/fdehau/tui-rs/issues/286:
Those are used to define the viewport of the canvas. Only the points whose coordinates are within the viewport are displayed. When you render the canvas using Frame::render_widget, you give an area to draw the widget to (a Rect) and the crate translates the floating point coordinates to those used by our internal terminal representation.