pub struct CanvasScope { /* private fields */ }Expand description
A Canvas and its builder.
Implementations§
Source§impl CanvasScope
impl CanvasScope
Sourcepub fn view_box(self, width: f32, height: f32) -> Self
pub fn view_box(self, width: f32, height: f32) -> Self
Scales the command list’s coordinates from (width, height) to the Canvas’s
measured width and height. Stroke widths stay in dp.
Sourcepub fn fractional(self) -> Self
pub fn fractional(self) -> Self
Scales the command list’s coordinates as 0.0..=1.0 fractions of the Canvas’s
measured width and height. Stroke widths stay in dp.
Source§impl CanvasScope
impl CanvasScope
Source§impl CanvasScope
impl CanvasScope
Sourcepub fn on_motion_finished(
self,
handler: impl FnMut(MotionFinished) + 'static,
) -> Self
pub fn on_motion_finished( self, handler: impl FnMut(MotionFinished) + 'static, ) -> Self
Runs once when this node’s size motion comes to rest, with the size it settled
at in dp. The node needs Modifier::motion for its size to move; without it
nothing is reported. A run interrupted by a newer size is not reported, only
the one that settles, and under reduced motion it arrives in the frame the
size changes in.
Trait Implementations§
Source§impl Drop for CanvasScope
impl Drop for CanvasScope
Auto Trait Implementations§
impl !RefUnwindSafe for CanvasScope
impl !Send for CanvasScope
impl !Sync for CanvasScope
impl !UnwindSafe for CanvasScope
impl Forget for CanvasScope
impl Freeze for CanvasScope
impl Move for CanvasScope
impl Unpin for CanvasScope
impl UnsafeUnpin for CanvasScope
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