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§
Sourcefn change_style(&self, state: &mut StyleContext)
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);
}
}