pub struct CurveEditor {Show 20 fields
pub curve_set: CurveSet,
pub visible_channels: Vec<bool>,
pub selected_points: Vec<PointSelection>,
pub canvas_time_range: (f32, f32),
pub canvas_value_range: (f32, f32),
pub canvas_size: Vec2,
pub grid_lines_x: u32,
pub grid_lines_y: u32,
pub show_tangent_handles: bool,
pub show_reference_line: bool,
pub reference_value: f32,
pub snap_x: bool,
pub snap_y: bool,
pub snap_x_step: f32,
pub snap_y_step: f32,
pub dragging: Option<PointSelection>,
pub drag_start_pos: Vec2,
pub frame_time: f32,
pub play_cursor: f32,
pub looping: bool,
/* private fields */
}Fields§
§curve_set: CurveSet§visible_channels: Vec<bool>§selected_points: Vec<PointSelection>§canvas_time_range: (f32, f32)§canvas_value_range: (f32, f32)§canvas_size: Vec2§grid_lines_x: u32§grid_lines_y: u32§show_tangent_handles: bool§show_reference_line: bool§reference_value: f32§snap_x: bool§snap_y: bool§snap_x_step: f32§snap_y_step: f32§dragging: Option<PointSelection>§drag_start_pos: Vec2§frame_time: f32§play_cursor: f32§looping: boolImplementations§
Source§impl CurveEditor
impl CurveEditor
pub fn new(canvas_w: f32, canvas_h: f32) -> Self
pub fn load_set(&mut self, set: CurveSet)
Sourcepub fn canvas_to_curve(&self, cx: f32, cy: f32) -> Vec2
pub fn canvas_to_curve(&self, cx: f32, cy: f32) -> Vec2
Canvas-space to curve-space
Sourcepub fn curve_to_canvas(&self, tx: f32, ty: f32) -> Vec2
pub fn curve_to_canvas(&self, tx: f32, ty: f32) -> Vec2
Curve-space to canvas-space
pub fn add_point(&mut self, channel: usize, pos: Vec2)
pub fn remove_point(&mut self, channel: usize, idx: usize)
pub fn move_point(&mut self, sel: PointSelection, new_pos: Vec2)
pub fn set_kind(&mut self, channel: usize, kind: CurveKind)
pub fn auto_smooth_tangents(&mut self, channel: usize)
pub fn flatten_tangents(&mut self, channel: usize)
pub fn select_all(&mut self)
pub fn deselect_all(&mut self)
pub fn undo(&mut self)
pub fn redo(&mut self)
pub fn advance_play_cursor(&mut self, dt: f32)
pub fn evaluate_all_at_cursor(&self) -> Vec<f32>
pub fn frame_all(&mut self)
pub fn zoom(&mut self, factor: f32, center_t: f32, center_v: f32)
pub fn pan(&mut self, dt: f32, dv: f32)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CurveEditor
impl RefUnwindSafe for CurveEditor
impl Send for CurveEditor
impl Sync for CurveEditor
impl Unpin for CurveEditor
impl UnsafeUnpin for CurveEditor
impl UnwindSafe for CurveEditor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.