Trait flo_canvas::GraphicsPrimitives
source · 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§
sourcefn rect(&mut self, x1: f32, y1: f32, x2: f32, y2: f32)
fn rect(&mut self, x1: f32, y1: f32, x2: f32, y2: f32)
Draws a rectangle between particular coordinates
sourcefn circle(&mut self, center_x: f32, center_y: f32, radius: f32)
fn circle(&mut self, center_x: f32, center_y: f32, radius: f32)
Draws a circle at a particular point
sourcefn bezier_path<TPath: BezierPath>(&mut self, path: &TPath)where
TPath::Point: Coordinate2D,
fn bezier_path<TPath: BezierPath>(&mut self, path: &TPath)where TPath::Point: Coordinate2D,
Draws a bezier path
sourcefn bezier_curve<TCurve: BezierCurve>(&mut self, curve: &TCurve)where
TCurve::Point: Coordinate2D,
fn bezier_curve<TCurve: BezierCurve>(&mut self, curve: &TCurve)where TCurve::Point: Coordinate2D,
Draws a bezier curve (defined by the BezierCurve trait)
sourcefn draw_list<'a, DrawIter: 'a + IntoIterator<Item = Draw>>(
&'a mut self,
drawing: DrawIter
)
fn draw_list<'a, DrawIter: 'a + IntoIterator<Item = Draw>>( &'a mut self, drawing: DrawIter )
Draws a series of instructions
Implementors§
impl<'a> GraphicsPrimitives for dyn GraphicsContext + 'a
The dynamic graphics context object also implements the graphics primitives
impl<T> GraphicsPrimitives for Twhere T: GraphicsContext,
All graphics contexts provide graphics primitives