pub trait GraphicsPrimitives: GraphicsContext {
    // Provided methods
    fn rect(&mut self, x1: f32, y1: f32, x2: f32, y2: f32) { ... }
    fn circle(&mut self, center_x: f32, center_y: f32, radius: f32) { ... }
    fn bezier_path<TPath: BezierPath>(&mut self, path: &TPath)
       where TPath::Point: Coordinate2D { ... }
    fn bezier_curve<TCurve: BezierCurve>(&mut self, curve: &TCurve)
       where TCurve::Point: Coordinate2D { ... }
    fn draw_list<'a, DrawIter: 'a + IntoIterator<Item = Draw>>(
        &'a mut self,
        drawing: DrawIter
    ) { ... }
}
Expand description

GraphicsPrimitives adds new primitives that can be built directly from a graphics context

Provided Methods§

source

fn rect(&mut self, x1: f32, y1: f32, x2: f32, y2: f32)

Draws a rectangle between particular coordinates

source

fn circle(&mut self, center_x: f32, center_y: f32, radius: f32)

Draws a circle at a particular point

source

fn bezier_path<TPath: BezierPath>(&mut self, path: &TPath)where TPath::Point: Coordinate2D,

Draws a bezier path

source

fn bezier_curve<TCurve: BezierCurve>(&mut self, curve: &TCurve)where TCurve::Point: Coordinate2D,

Draws a bezier curve (defined by the BezierCurve trait)

source

fn draw_list<'a, DrawIter: 'a + IntoIterator<Item = Draw>>( &'a mut self, drawing: DrawIter )

Draws a series of instructions

Implementors§

source§

impl<'a> GraphicsPrimitives for dyn GraphicsContext + 'a

The dynamic graphics context object also implements the graphics primitives

source§

impl<T> GraphicsPrimitives for Twhere T: GraphicsContext,

All graphics contexts provide graphics primitives