pub struct SnapSettings {
pub enabled: bool,
pub snap_to_playhead: bool,
pub snap_to_clips: bool,
pub snap_to_markers: bool,
pub threshold: i64,
}Expand description
Snap settings for timeline editing.
Fields§
§enabled: boolEnable snapping.
snap_to_playhead: boolSnap to playhead.
snap_to_clips: boolSnap to clip edges.
snap_to_markers: boolSnap to markers.
threshold: i64Snap threshold (in timebase units).
Implementations§
Source§impl SnapSettings
impl SnapSettings
Sourcepub fn should_snap(&self, position: i64, target: i64) -> bool
pub fn should_snap(&self, position: i64, target: i64) -> bool
Check if a position should snap to a target.
Sourcepub fn snap_position(&self, position: i64, targets: &[i64]) -> i64
pub fn snap_position(&self, position: i64, targets: &[i64]) -> i64
Get snap position if within threshold.
Trait Implementations§
Source§impl Clone for SnapSettings
impl Clone for SnapSettings
Source§fn clone(&self) -> SnapSettings
fn clone(&self) -> SnapSettings
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SnapSettings
impl Debug for SnapSettings
Auto Trait Implementations§
impl Freeze for SnapSettings
impl RefUnwindSafe for SnapSettings
impl Send for SnapSettings
impl Sync for SnapSettings
impl Unpin for SnapSettings
impl UnsafeUnpin for SnapSettings
impl UnwindSafe for SnapSettings
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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