pub trait Renderer: Rendererwhere
    Self::Theme: StyleSheet,{
    // Required method
    fn draw(
        &mut self,
        bounds: Rectangle,
        cursor_position: Point,
        normal: Normal,
        bipolar_center: Option<Normal>,
        dragging_status: bool,
        mod_range_1: Option<&ModulationRange>,
        mod_range_2: Option<&ModulationRange>,
        tick_marks: Option<&Group>,
        text_marks: Option<&Group>,
        style_sheet: &dyn StyleSheet<Style = <Self::Theme as StyleSheet>::Style>,
        style: &<Self::Theme as StyleSheet>::Style,
        tick_marks_cache: &PrimitiveCache,
        text_marks_cache: &PrimitiveCache
    );
}
Expand description

The renderer of a Knob.

Your renderer will need to implement this trait before being able to use a Knob in your user interface.

Required Methods§

source

fn draw( &mut self, bounds: Rectangle, cursor_position: Point, normal: Normal, bipolar_center: Option<Normal>, dragging_status: bool, mod_range_1: Option<&ModulationRange>, mod_range_2: Option<&ModulationRange>, tick_marks: Option<&Group>, text_marks: Option<&Group>, style_sheet: &dyn StyleSheet<Style = <Self::Theme as StyleSheet>::Style>, style: &<Self::Theme as StyleSheet>::Style, tick_marks_cache: &PrimitiveCache, text_marks_cache: &PrimitiveCache )

Draws a Knob.

It receives:

  • the bounds of the Knob
  • the current cursor position
  • the current normal of the Knob
  • optionally, a custom bipolar center value
  • whether the knob is currently being dragged
  • any tick marks to display
  • any text marks to display
  • the style of the Knob

Implementations on Foreign Types§

source§

impl<Theme> Renderer for Renderer<Theme>where Self::Theme: StyleSheet,

source§

fn draw( &mut self, bounds: Rectangle, cursor_position: Point, normal: Normal, bipolar_center: Option<Normal>, is_dragging: bool, mod_range_1: Option<&ModulationRange>, mod_range_2: Option<&ModulationRange>, tick_marks: Option<&Group>, text_marks: Option<&Group>, style_sheet: &dyn StyleSheet<Style = <Self::Theme as StyleSheet>::Style>, style: &<Self::Theme as StyleSheet>::Style, tick_marks_cache: &PrimitiveCache, text_marks_cache: &PrimitiveCache )

Implementors§