pub struct Pen<'renderer> { /* private fields */ }
Expand description
A pen controls its color and renders geometries to the renderer.
This will render when be dropped. So you should re-create on every render.
Implementations§
Source§impl<'renderer> Pen<'renderer>
impl<'renderer> Pen<'renderer>
Sourcepub fn new(renderer: &'renderer Renderer<'_>) -> Self
pub fn new(renderer: &'renderer Renderer<'_>) -> Self
Constructs a pen from the renderer Renderer
.
Sourcepub fn blend_mode(&self) -> BlendMode
pub fn blend_mode(&self) -> BlendMode
Returns the current color blend mode.
Sourcepub fn set_blend_mode(&self, mode: BlendMode)
pub fn set_blend_mode(&self, mode: BlendMode)
Sets the color blend mode.
Sourcepub fn lines(&self, points: impl IntoIterator<Item = Point>)
pub fn lines(&self, points: impl IntoIterator<Item = Point>)
Draws the lines.
Sourcepub fn points(&self, points: impl IntoIterator<Item = Point>)
pub fn points(&self, points: impl IntoIterator<Item = Point>)
Draw the points.
Sourcepub fn stroke_rect(&self, rect: Rect)
pub fn stroke_rect(&self, rect: Rect)
Draw the rectangle only lines.
Sourcepub fn stroke_rects(&self, rects: impl IntoIterator<Item = Rect>)
pub fn stroke_rects(&self, rects: impl IntoIterator<Item = Rect>)
Draw the rectangles only lines.
Sourcepub fn fill_rects(&self, rects: impl IntoIterator<Item = Rect>)
pub fn fill_rects(&self, rects: impl IntoIterator<Item = Rect>)
Draw the filled rectangles.
Trait Implementations§
Auto Trait Implementations§
impl<'renderer> Freeze for Pen<'renderer>
impl<'renderer> !RefUnwindSafe for Pen<'renderer>
impl<'renderer> !Send for Pen<'renderer>
impl<'renderer> !Sync for Pen<'renderer>
impl<'renderer> Unpin for Pen<'renderer>
impl<'renderer> !UnwindSafe for Pen<'renderer>
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