GraphicsStyle

Trait GraphicsStyle 

Source
pub trait GraphicsStyle {
    // Required method
    fn change_style(&self, state: &mut StyleContext);

    // Provided method
    fn skip(&self) -> bool { ... }
}
Expand description

Trait for drawing a shape with a style.

Required Methods§

Source

fn change_style(&self, state: &mut StyleContext)

Draws a shape with a style.

§Arguments
  • state:

returns: ()

§Examples
use graphics_style::{Color, GraphicsStyle3D, StyleContext};
pub struct CustomLineStyle {
    pub width: f32,
    pub color: Color,
}

impl GraphicsStyle3D for CustomLineStyle {
    fn change_style(&self, state: &mut StyleContext) {
        state.line_width = Some(self.width);
        state.line_color = Some(self.color);
    }
}

Provided Methods§

Source

fn skip(&self) -> bool

Draws a shape with a style.

Trait Implementations§

Source§

impl Debug for dyn GraphicsStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§