[−][src]Struct rumatui_tui::widgets::canvas::Painter
Implementations
impl<'a, 'b> Painter<'a, 'b>
[src]
pub fn get_point(&self, x: f64, y: f64) -> Option<(usize, usize)>
[src]
Convert the (x, y) coordinates to location of a braille dot on the grid
Examples:
use rumatui_tui::widgets::canvas::{Painter, Context}; let mut ctx = Context::new(2, 2, [1.0, 2.0], [0.0, 2.0]); let mut painter = Painter::from(&mut ctx); let point = painter.get_point(1.0, 0.0); assert_eq!(point, Some((0, 7))); let point = painter.get_point(1.5, 1.0); assert_eq!(point, Some((1, 3))); let point = painter.get_point(0.0, 0.0); assert_eq!(point, None); let point = painter.get_point(2.0, 2.0); assert_eq!(point, Some((3, 0))); let point = painter.get_point(1.0, 2.0); assert_eq!(point, Some((0, 0)));
pub fn paint(&mut self, x: usize, y: usize, color: Color)
[src]
Paint a braille dot
Examples:
use rumatui_tui::{style::Color, widgets::canvas::{Painter, Context}}; let mut ctx = Context::new(1, 1, [0.0, 2.0], [0.0, 2.0]); let mut painter = Painter::from(&mut ctx); let cell = painter.paint(1, 3, Color::Red);
Trait Implementations
impl<'a, 'b> Debug for Painter<'a, 'b>
[src]
impl<'a, 'b> From<&'a mut Context<'b>> for Painter<'a, 'b>
[src]
Auto Trait Implementations
impl<'a, 'b> RefUnwindSafe for Painter<'a, 'b>
impl<'a, 'b> Send for Painter<'a, 'b>
impl<'a, 'b> Sync for Painter<'a, 'b>
impl<'a, 'b> Unpin for Painter<'a, 'b> where
'b: 'a,
'b: 'a,
impl<'a, 'b> !UnwindSafe for Painter<'a, 'b>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,