pub struct CurveTransformCell(/* private fields */);Implementations§
Source§impl CurveTransformCell
impl CurveTransformCell
Sourcepub fn position(
&self,
) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn position( &self, ) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
Position of the center of the curve editor in the curve coordinate space.
Sourcepub fn scale(&self) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn scale(&self) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
Scape of the curve editor: multiply curve space units by this to get screen space units.
Sourcepub fn bounds(&self) -> Rect<f32>
pub fn bounds(&self) -> Rect<f32>
Location of the curve editor on the screen, in screen space units.
Sourcepub fn set_position(
&self,
position: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>,
)
pub fn set_position( &self, position: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>, )
Modify the current position. Call this when the center of the curve view should change.
Sourcepub fn set_scale(
&self,
scale: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>,
)
pub fn set_scale( &self, scale: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>, )
Modify the current zoom of the curve view.
Sourcepub fn set_bounds(&self, bounds: Rect<f32>)
pub fn set_bounds(&self, bounds: Rect<f32>)
Update the bounds of the curve view. Call this to ensure the CurveTransform accurately reflects the actual size of the widget being drawn.
Sourcepub fn x_step_iter(&self, grid_size: f32) -> StepIterator ⓘ
pub fn x_step_iter(&self, grid_size: f32) -> StepIterator ⓘ
Just like CurveTransformCell::y_step_iter but for x-coordinates.
Iterate through a list of x-coordinates across the width of the bounds.
The x-coordinates are in curve-space, but their distance apart should be
at least grid_size in screen-space.
This iterator indates where grid lines should be drawn to make a curve easier to read for the user.
Sourcepub fn y_step_iter(&self, grid_size: f32) -> StepIterator ⓘ
pub fn y_step_iter(&self, grid_size: f32) -> StepIterator ⓘ
Just like CurveTransformCell::x_step_iter but for y-coordinates.
Iterate through a list of y-coordinates across the width of the bounds.
The y-coordinates are in curve-space, but their distance apart should be
at least grid_size in screen-space.
This iterator indates where grid lines should be drawn to make a curve easier to read for the user.
Sourcepub fn update_transform(&self)
pub fn update_transform(&self)
Construct the transformation matrices to reflect the current position, scale, and bounds.
Sourcepub fn curve_to_local(
&self,
) -> MappedMutexGuard<'_, RawMutex, Matrix<f32, Const<3>, Const<3>, ArrayStorage<f32, 3, 3>>>
pub fn curve_to_local( &self, ) -> MappedMutexGuard<'_, RawMutex, Matrix<f32, Const<3>, Const<3>, ArrayStorage<f32, 3, 3>>>
Transform a point on the curve into a point in the local coordinate space of the widget.
Sourcepub fn curve_to_screen(
&self,
) -> MappedMutexGuard<'_, RawMutex, Matrix<f32, Const<3>, Const<3>, ArrayStorage<f32, 3, 3>>>
pub fn curve_to_screen( &self, ) -> MappedMutexGuard<'_, RawMutex, Matrix<f32, Const<3>, Const<3>, ArrayStorage<f32, 3, 3>>>
Transform a point on the curve into a point on the screen.
Sourcepub fn local_to_curve(
&self,
) -> MappedMutexGuard<'_, RawMutex, Matrix<f32, Const<3>, Const<3>, ArrayStorage<f32, 3, 3>>>
pub fn local_to_curve( &self, ) -> MappedMutexGuard<'_, RawMutex, Matrix<f32, Const<3>, Const<3>, ArrayStorage<f32, 3, 3>>>
Transform a point in the local coordinate space of the widget into a point in the coordinate space of the curve. After the transformation, the x-coordinate could be a key location and the y-coordinate could be a key value. Y-coordinates are flipped so that positive-y becomes the up direction.
Sourcepub fn screen_to_curve(
&self,
) -> MappedMutexGuard<'_, RawMutex, Matrix<f32, Const<3>, Const<3>, ArrayStorage<f32, 3, 3>>>
pub fn screen_to_curve( &self, ) -> MappedMutexGuard<'_, RawMutex, Matrix<f32, Const<3>, Const<3>, ArrayStorage<f32, 3, 3>>>
Transform a point on the screen into a point in the coordinate space of the curve. After the transformation, the x-coordinate could be a key location and the y-coordinate could be a key value. Y-coordinates are flipped so that positive-y becomes the up direction.
Trait Implementations§
Source§impl Clone for CurveTransformCell
impl Clone for CurveTransformCell
Source§fn clone(&self) -> CurveTransformCell
fn clone(&self) -> CurveTransformCell
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CurveTransformCell
impl Debug for CurveTransformCell
Source§impl Default for CurveTransformCell
impl Default for CurveTransformCell
Source§fn default() -> CurveTransformCell
fn default() -> CurveTransformCell
Auto Trait Implementations§
impl !Freeze for CurveTransformCell
impl !RefUnwindSafe for CurveTransformCell
impl Send for CurveTransformCell
impl Sync for CurveTransformCell
impl Unpin for CurveTransformCell
impl UnwindSafe for CurveTransformCell
Blanket Implementations§
Source§impl<T> AsyncTaskResult for T
impl<T> AsyncTaskResult for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Any. Could be used to downcast a trait object
to a particular type.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Any. Could be used to downcast a trait object
to a particular type.fn into_any(self: Box<T>) -> Box<dyn Any>
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<T> ScriptMessagePayload for T
impl<T> ScriptMessagePayload for T
Source§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
self as &dyn AnySource§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
self as &dyn AnySource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.