pub enum DrawCommand {
Line {
paint: Paint,
x1: f32,
y1: f32,
x2: f32,
y2: f32,
stroke_width: f32,
},
Rect {
paint: Paint,
x: f32,
y: f32,
width: f32,
height: f32,
stroke_width: f32,
},
RoundRect {
paint: Paint,
x: f32,
y: f32,
width: f32,
height: f32,
radius: f32,
stroke_width: f32,
},
Circle {
paint: Paint,
center_x: f32,
center_y: f32,
radius: f32,
stroke_width: f32,
},
Arc {
paint: Paint,
center_x: f32,
center_y: f32,
radius: f32,
start_degrees: f32,
sweep_degrees: f32,
stroke_width: f32,
},
PolylineRef {
paint: Paint,
asset_id: u32,
stroke_width: f32,
},
TextAt {
paint: Paint,
text_offset: u32,
text_length: u32,
x: f32,
y: f32,
type_role: TypeRole,
},
}Expand description
One drawing command. Coordinates are dp from the widget’s top-left corner.
Variants§
Line
Rect
A stroke width of zero fills the rectangle.
RoundRect
Circle
Arc
Fields
PolylineRef
Points live in a registered asset, so a path of any length costs one record.
TextAt
The text bytes follow the command array inside the same list, and the offset is measured from the start of that list, so the list decodes on its own.
Implementations§
Trait Implementations§
Source§impl Clone for DrawCommand
impl Clone for DrawCommand
impl Copy for DrawCommand
Source§impl Debug for DrawCommand
impl Debug for DrawCommand
Source§impl PartialEq for DrawCommand
impl PartialEq for DrawCommand
impl StructuralPartialEq for DrawCommand
Auto Trait Implementations§
impl Freeze for DrawCommand
impl RefUnwindSafe for DrawCommand
impl Send for DrawCommand
impl Sync for DrawCommand
impl Unpin for DrawCommand
impl UnsafeUnpin for DrawCommand
impl UnwindSafe for DrawCommand
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