pub enum CustomGeomPoint {
MoveTo(f64, f64),
LineTo(f64, f64),
ArcTo {
w_r: f64,
h_r: f64,
start_angle: f64,
swing_angle: f64,
},
CubicBezTo(f64, f64, f64, f64, f64, f64),
QuadBezTo(f64, f64, f64, f64),
Close,
}Expand description
A single drawing operation in a custom freeform shape path.
Coordinates are fractions of the shape’s bounding box: (0.0, 0.0) = top-left,
(1.0, 1.0) = bottom-right.
§Example
use deckmint::types::CustomGeomPoint as CGP;
// Triangle
let pts = vec![
CGP::MoveTo(0.5, 0.0), // top-center
CGP::LineTo(1.0, 1.0), // bottom-right
CGP::LineTo(0.0, 1.0), // bottom-left
CGP::Close,
];Variants§
MoveTo(f64, f64)
Start of a sub-path at (x, y).
LineTo(f64, f64)
Straight line to (x, y).
ArcTo
Arc whose ellipse has radii (w_r, h_r) (fractions of shape size),
starting at start_angle degrees and sweeping swing_angle degrees clockwise.
CubicBezTo(f64, f64, f64, f64, f64, f64)
Cubic Bézier to end via control points cp1 and cp2.
Fields: (cp1_x, cp1_y, cp2_x, cp2_y, end_x, end_y)
QuadBezTo(f64, f64, f64, f64)
Quadratic Bézier to end via control point cp.
Fields: (cp_x, cp_y, end_x, end_y)
Close
Close the current sub-path (draws a straight line back to the last MoveTo).
Trait Implementations§
Source§impl Clone for CustomGeomPoint
impl Clone for CustomGeomPoint
Source§fn clone(&self) -> CustomGeomPoint
fn clone(&self) -> CustomGeomPoint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CustomGeomPoint
impl RefUnwindSafe for CustomGeomPoint
impl Send for CustomGeomPoint
impl Sync for CustomGeomPoint
impl Unpin for CustomGeomPoint
impl UnsafeUnpin for CustomGeomPoint
impl UnwindSafe for CustomGeomPoint
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