pub struct CurveEditor<'a> { /* private fields */ }Expand description
The curve editor.
Need (image): a curve editor.
Implementations§
Source§impl<'a> CurveEditor<'a>
impl<'a> CurveEditor<'a>
Sourcepub fn new(points: &'a mut Vec<[f32; 2]>, label: &str) -> CurveEditor<'a>
pub fn new(points: &'a mut Vec<[f32; 2]>, label: &str) -> CurveEditor<'a>
An editor of points, named label for screen readers.
Sourcepub fn spline(self, spline: &'a dyn Spline) -> Self
pub fn spline(self, spline: &'a dyn Spline) -> Self
The curve’s maths (MonotoneCubic by default).
Sourcepub fn default_points(self, points: Vec<[f32; 2]>) -> Self
pub fn default_points(self, points: Vec<[f32; 2]>) -> Self
The points a reset goes back to (the identity by default).
Sourcepub fn pick(self, pick: Option<Pick>) -> Self
pub fn pick(self, pick: Option<Pick>) -> Self
The value picked under the pointer in the image, and what the pointer does (the targeted adjustment).
Sourcepub fn size(self, size: Vec2) -> Self
pub fn size(self, size: Vec2) -> Self
The size in points (default: the available width, square, at most 320).
Sourcepub fn color(self, color: Color32) -> Self
pub fn color(self, color: Color32) -> Self
The curve’s colour (a channel’s; curve.line by default).
Sourcepub fn step(self, step: f32) -> Self
pub fn step(self, step: f32) -> Self
How far an arrow key moves a point (a hundredth by default).
Sourcepub fn max_points(self, n: usize) -> Self
pub fn max_points(self, n: usize) -> Self
The most points the curve may have (20 by default).
Sourcepub fn on_change(
self,
hook: impl FnMut(&Change<Vec<[f32; 2]>>) -> Verdict<Vec<[f32; 2]>> + 'a,
) -> Self
pub fn on_change( self, hook: impl FnMut(&Change<Vec<[f32; 2]>>) -> Verdict<Vec<[f32; 2]>> + 'a, ) -> Self
Sees each change before it is written: allow, veto or redirect (other points).
Sourcepub fn show(self, ui: &mut Ui) -> CurveOutput
pub fn show(self, ui: &mut Ui) -> CurveOutput
Draws the editor; says what changed.
Trait Implementations§
Source§impl<'a> Debug for CurveEditor<'a>
impl<'a> Debug for CurveEditor<'a>
Auto Trait Implementations§
impl<'a> Freeze for CurveEditor<'a>
impl<'a> !RefUnwindSafe for CurveEditor<'a>
impl<'a> !Send for CurveEditor<'a>
impl<'a> !Sync for CurveEditor<'a>
impl<'a> Unpin for CurveEditor<'a>
impl<'a> UnsafeUnpin for CurveEditor<'a>
impl<'a> !UnwindSafe for CurveEditor<'a>
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.