pub struct Canvas { /* private fields */ }Implementations§
Source§impl Canvas
impl Canvas
pub fn new(size: Size) -> Self
pub fn size(&self) -> Size
pub fn measure_text( &self, text: impl AsRef<str>, style: &TextStyle, ) -> TextMetrics
pub fn clear(&mut self, color: Color)
pub fn rect(&mut self, rect: Rect, color: Color)
pub fn round_rect(&mut self, rect: Rect, radius: f32, color: Color)
pub fn line(&mut self, start: Point, end: Point, stroke: Stroke, color: Color)
pub fn circle(&mut self, center: Point, radius: f32, color: Color)
pub fn ellipse( &mut self, center: Point, radius_x: f32, radius_y: f32, color: Color, )
pub fn text( &mut self, position: Point, text: impl Into<String>, style: TextStyle, color: Color, )
pub fn image_placeholder(&mut self, rect: Rect, color: Color)
pub fn clip_rect(&mut self, rect: Rect)
pub fn save(&mut self)
pub fn restore(&mut self)
pub fn translate(&mut self, dx: f32, dy: f32)
Sourcepub fn experimental_raw(&mut self, f: impl FnOnce(&mut RawCanvas<'_>))
pub fn experimental_raw(&mut self, f: impl FnOnce(&mut RawCanvas<'_>))
Runs an experimental low-level command sink against this canvas.
RawCanvas and the command types behind it are available from
widgetkit_render::unstable. They are intentionally not re-exported by the top-level
widgetkit facade and may change in any 0.x release.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Canvas
impl RefUnwindSafe for Canvas
impl Send for Canvas
impl Sync for Canvas
impl Unpin for Canvas
impl UnsafeUnpin for Canvas
impl UnwindSafe for Canvas
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