pub struct Canvas {
pub width: f32,
pub height: f32,
pub x: f32,
pub y: f32,
pub components: Rc<RefCell<Vec<Component>>>,
pub margin: Box,
}
Fields§
§width: f32
§height: f32
§x: f32
§y: f32
§components: Rc<RefCell<Vec<Component>>>
§margin: Box
Implementations§
Source§impl Canvas
impl Canvas
Sourcepub fn new_width_xy(width: f32, height: f32, x: f32, y: f32) -> Self
pub fn new_width_xy(width: f32, height: f32, x: f32, y: f32) -> Self
Creates a specified size canvas and set the x and y value.
Sourcepub fn child_left_top(&self, margin: Box) -> Self
pub fn child_left_top(&self, margin: Box) -> Self
Creates a child canvas and sets the left top value.
Sourcepub fn smooth_line(&mut self, line: SmoothLine) -> Box
pub fn smooth_line(&mut self, line: SmoothLine) -> Box
Appends smooth line points widget to canvas.
Sourcepub fn straight_line(&mut self, line: StraightLine) -> Box
pub fn straight_line(&mut self, line: StraightLine) -> Box
Appends straight line points widget to canvas.
Sourcepub fn smooth_line_fill(&mut self, fill: SmoothLineFill) -> Box
pub fn smooth_line_fill(&mut self, fill: SmoothLineFill) -> Box
Appends smooth line points with fill color widget to canvas.
Sourcepub fn straight_line_fill(&mut self, fill: StraightLineFill) -> Box
pub fn straight_line_fill(&mut self, fill: StraightLineFill) -> Box
Appends straight line points with fill color widget to canvas.
pub fn grid(&mut self, grip: Grid) -> Box
pub fn axis(&mut self, axis: Axis) -> Box
pub fn append(&mut self, component: Component)
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 !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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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