pub struct DrawCtx { /* private fields */ }Expand description
What a crate::Custom node draws into. Coordinates are the node’s own:
the origin is the node center, positive x is right, positive y is down.
The closure runs every time the frame is painted. It has to be a function
of t, of signals it captured, and of DrawCtx::rng: the same inputs
must produce the same shapes, because a frame can be painted more than
once and a seek paints it without the frames in between.
Implementations§
Source§impl DrawCtx
impl DrawCtx
Sourcepub fn quality(&self) -> f64
pub fn quality(&self) -> f64
1 is a full frame. A later draft mode will pass a smaller value so a closure can draw fewer shapes; it does not change positions.
Sourcepub fn rng(&self, seed: u64) -> DrawRng
pub fn rng(&self, seed: u64) -> DrawRng
Generator for seed. It does not touch the scene’s random(), and
the same seed is the same sequence on every paint of this frame.
Sourcepub fn line(&mut self, a: impl Into<Point>, b: impl Into<Point>) -> Pen<'_>
pub fn line(&mut self, a: impl Into<Point>, b: impl Into<Point>) -> Pen<'_>
A straight segment from a to b.
Auto Trait Implementations§
impl !Send for DrawCtx
impl !Sync for DrawCtx
impl Freeze for DrawCtx
impl RefUnwindSafe for DrawCtx
impl Unpin for DrawCtx
impl UnsafeUnpin for DrawCtx
impl UnwindSafe for DrawCtx
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