[][src]Trait pushrod::render::canvas_helper::CanvasHelper

pub trait CanvasHelper: Widget {
    fn draw_point(&mut self, c: &mut Canvas<Window>, x: i32, y: i32) { ... }
fn draw_bounding_box(&mut self, c: &mut Canvas<Window>) { ... }
fn get_rect_dest(&mut self) -> Rect { ... } }

This trait is used in conjunction with Widgets or anything else that draws to a Canvas object. It provides convenience methods to provide drawing functions common to Widgets. All points and dimensions are relative to the position of the Widget, so no translation is necessary.

To implement this trait in your Widget, all you have to do is:

This example is not tested
impl CanvasHelper for (myWidget) { }

Provided methods

fn draw_point(&mut self, c: &mut Canvas<Window>, x: i32, y: i32)

Draws a point in the Canvas.

fn draw_bounding_box(&mut self, c: &mut Canvas<Window>)

Draws a box around the bounding area of the Widget.

fn get_rect_dest(&mut self) -> Rect

Returns a Rect destination object

Loading content...

Implementors

impl CanvasHelper for CheckboxWidget[src]

impl CanvasHelper for GridWidget[src]

impl CanvasHelper for ListWidget[src]

impl CanvasHelper for SliderWidget[src]

Loading content...