pub enum Prim {
Rect {
x: f32,
y: f32,
w: f32,
h: f32,
fill: Option<Rgba>,
stroke: Option<(Rgba, f32)>,
radius: f32,
},
Line {
pts: Vec<[f32; 2]>,
color: Rgba,
width: f32,
dash: bool,
},
Polygon {
pts: Vec<[f32; 2]>,
fill: Rgba,
stroke: Option<(Rgba, f32)>,
},
Wedge {
cx: f32,
cy: f32,
r_outer: f32,
r_inner: f32,
a0: f32,
a1: f32,
fill: Rgba,
stroke: Option<(Rgba, f32)>,
},
Circle {
cx: f32,
cy: f32,
r: f32,
fill: Option<Rgba>,
stroke: Option<(Rgba, f32)>,
},
Text {
x: f32,
y: f32,
text: String,
size: f32,
color: Rgba,
bold: bool,
align: HAlign,
valign: VAlign,
rotation: f32,
},
}Expand description
A drawing primitive in chart coordinates (origin top-left, y down, units = points/pixels).
Variants§
Rect
Line
Polygon
Wedge
Pie/doughnut sector: centre, radii, angles in radians (0 = 12 o’clock, clockwise).
Fields
Circle
Text
Text anchored at (x, y) per align/valign, rotated by rotation radians about the anchor.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Prim
impl<'de> Deserialize<'de> for Prim
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Prim
Auto Trait Implementations§
impl Freeze for Prim
impl RefUnwindSafe for Prim
impl Send for Prim
impl Sync for Prim
impl Unpin for Prim
impl UnsafeUnpin for Prim
impl UnwindSafe for Prim
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