pub struct Draw { /* private fields */ }Implementations§
Source§impl Draw
impl Draw
Sourcepub fn fill(&mut self, shape: Shape, paint: impl Into<Paint>)
pub fn fill(&mut self, shape: Shape, paint: impl Into<Paint>)
Fill a shape with a solid color or a [LinearGradient] (both convert to Paint;
gradient unit points resolve against the shape’s bounding box — docs/shapes.md §3.2).
pub fn stroke(&mut self, shape: Shape, color: Color, width: f64)
pub fn text(&mut self, text: &str, at: Point, style: TextStyle)
Sourcepub fn save(&mut self)
pub fn save(&mut self)
Save the current transform/clip; pair with Draw::restore.
Sourcepub fn restore(&mut self)
pub fn restore(&mut self)
Restore the transform/clip saved by the matching Draw::save.
Sourcepub fn concat(&mut self, m: Affine)
pub fn concat(&mut self, m: Affine)
Multiply an affine onto the current transform (shape rotate/scale/offset, §11).
Sourcepub fn transformed(&mut self, m: Affine, f: impl FnOnce(&mut Draw))
pub fn transformed(&mut self, m: Affine, f: impl FnOnce(&mut Draw))
Draw within m applied to the CTM, restoring afterwards.
Auto Trait Implementations§
impl Freeze for Draw
impl RefUnwindSafe for Draw
impl Send for Draw
impl Sync for Draw
impl Unpin for Draw
impl UnsafeUnpin for Draw
impl UnwindSafe for Draw
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more