pub struct Canvas<'a> { /* private fields */ }Expand description
Where a drawn widget draws. Records operations; draws nothing itself.
Implementations§
Source§impl<'a> Canvas<'a>
impl<'a> Canvas<'a>
pub fn new(size: Size, metrics: &'a PlatformMetrics) -> Canvas<'a>
Sourcepub fn metrics(&self) -> &PlatformMetrics
pub fn metrics(&self) -> &PlatformMetrics
Font sizes and spacing tokens, for sizing things like the platform does.
pub fn fill(&mut self, shape: impl Into<Shape>, color: Color)
pub fn stroke(&mut self, shape: impl Into<Shape>, color: Color, width: f32)
pub fn finish(self) -> DisplayList
Auto Trait Implementations§
impl<'a> Forget for Canvas<'a>
impl<'a> Freeze for Canvas<'a>
impl<'a> RefUnwindSafe for Canvas<'a>
impl<'a> Send for Canvas<'a>
impl<'a> Sync for Canvas<'a>
impl<'a> Unpin for Canvas<'a>
impl<'a> UnsafeUnpin for Canvas<'a>
impl<'a> UnwindSafe for Canvas<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more