[][src]Trait pizarra::shape::ShapeTrait

pub trait ShapeTrait {
    pub fn handle_mouse_moved(&mut self, pos: Point);
pub fn handle_button_pressed(&mut self, pos: Point);
pub fn handle_button_released(&mut self, pos: Point) -> ShapeFinished;
pub fn draw_commands(&self) -> DrawCommand;
pub fn bbox(&self) -> [[f64; 2]; 2];
pub fn shape_type(&self) -> ShapeType;
pub fn intersects_circle(&self, center: Point, radius: f64) -> bool;
pub fn color(&self) -> Color; }

Required methods

pub fn handle_mouse_moved(&mut self, pos: Point)[src]

Must handle new coordinates given to this shape. If this method is called it means that the shape is being modified (thus this is the most recently added shape

pub fn handle_button_pressed(&mut self, pos: Point)[src]

pub fn handle_button_released(&mut self, pos: Point) -> ShapeFinished[src]

pub fn draw_commands(&self) -> DrawCommand[src]

Must return the necessary commands to display this shape on the screen

pub fn bbox(&self) -> [[f64; 2]; 2][src]

Must know its bbox

pub fn shape_type(&self) -> ShapeType[src]

Returns the current shape type

pub fn intersects_circle(&self, center: Point, radius: f64) -> bool[src]

does this circle intersect this shape? Used by the eraser

pub fn color(&self) -> Color[src]

returns the color of this shape

Loading content...

Implementors

impl ShapeTrait for Path[src]

impl ShapeTrait for Circle[src]

impl ShapeTrait for Ellipse[src]

impl ShapeTrait for Polygon[src]

impl ShapeTrait for Rectangle[src]

Loading content...