pub struct FlowMotion { /* private fields */ }Implementations§
Source§impl FlowMotion
impl FlowMotion
pub fn set_reduced(&mut self, reduced: bool)
pub fn reduced(&self) -> bool
Sourcepub fn set_live_offset(&mut self, id: NodeId, offset: Vec2)
pub fn set_live_offset(&mut self, id: NodeId, offset: Vec2)
拖拽中:节点显示位置相对模型位置的偏移(跟手,无动画)。
Sourcepub fn cancel_live(&mut self)
pub fn cancel_live(&mut self)
取消拖拽:偏移立即清零。
Sourcepub fn own_offset(&self, id: NodeId, now: f64) -> Vec2
pub fn own_offset(&self, id: NodeId, now: f64) -> Vec2
节点自身(不含祖先)的显示偏移。
pub fn has_offsets(&self) -> bool
pub fn node_entered(&mut self, id: NodeId, now: f64)
pub fn enter_sample(&self, id: NodeId, now: f64) -> Appear
pub fn node_removed(&mut self, node: Node, rect: Rect, now: f64)
Sourcepub fn drop_ghost(&mut self, id: NodeId)
pub fn drop_ghost(&mut self, id: NodeId)
撤销删除时,节点回来就不再画它的残影。
pub fn edge_added(&mut self, id: EdgeId, now: f64)
Sourcepub fn draw_progress(&self, id: EdgeId, now: f64) -> f32
pub fn draw_progress(&self, id: EdgeId, now: f64) -> f32
绘入比例 0..=1。
pub fn reject(&mut self, port: PortId, now: f64)
Sourcepub fn shake(&self, now: f64) -> Option<(PortId, f32)>
pub fn shake(&self, now: f64) -> Option<(PortId, f32)>
非法目标端口的水平抖动(屏幕 px):0 → −A → A → −A/2 → A/2 → 0 的线性关键帧。
Sourcepub fn target_changed(&mut self, port: Option<PortId>, now: f64)
pub fn target_changed(&mut self, port: Option<PortId>, now: f64)
连线草稿吸附到了新的目标端口。
Sourcepub fn target_sample(&self, port: PortId, now: f64) -> (f32, Option<f32>)
pub fn target_sample(&self, port: PortId, now: f64) -> (f32, Option<f32>)
目标端口的放大倍数与光晕进度(0 → 1 淡出)。
Sourcepub fn animate_view(
&mut self,
from: &Viewport,
to: &Viewport,
center: Vec2,
now: f64,
) -> bool
pub fn animate_view( &mut self, from: &Viewport, to: &Viewport, center: Vec2, now: f64, ) -> bool
从 from 平滑过渡到 to;center 为视图中心(屏幕坐标)。返回 false 表示应立即跳转。
pub fn cancel_view(&mut self)
pub fn view_animating(&self) -> bool
Sourcepub fn view_sample(
&self,
base: &Viewport,
center: Vec2,
now: f64,
) -> Option<(Viewport, bool)>
pub fn view_sample( &self, base: &Viewport, center: Vec2, now: f64, ) -> Option<(Viewport, bool)>
视口取样,结束时返回 (终点, true)。
Sourcepub fn dash_phase(&self, now: f64) -> f32
pub fn dash_phase(&self, now: f64) -> f32
运行中边的虚线相位(屏幕 px)。
pub fn finish_view(&mut self)
Trait Implementations§
Source§impl Debug for FlowMotion
impl Debug for FlowMotion
Auto Trait Implementations§
impl Forget for FlowMotion
impl Freeze for FlowMotionwhere
*const u8 is !null: Freeze,
PhantomData<(NodeId, Vec2)>: Freeze,
PhantomData<(NodeId, Spring2)>: Freeze,
PhantomData<(NodeId, Tween)>: Freeze,
PhantomData<Ghost>: Freeze,
PhantomData<(EdgeId, Tween)>: Freeze,
impl Move for FlowMotion
impl RefUnwindSafe for FlowMotion
impl Send for FlowMotion
impl Sync for FlowMotion
impl Unpin for FlowMotion
impl UnsafeUnpin for FlowMotionwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<(NodeId, Vec2)>: UnsafeUnpin,
PhantomData<(NodeId, Spring2)>: UnsafeUnpin,
PhantomData<(NodeId, Tween)>: UnsafeUnpin,
PhantomData<Ghost>: UnsafeUnpin,
PhantomData<(EdgeId, Tween)>: UnsafeUnpin,
impl UnwindSafe for FlowMotionwhere
HashMap<NodeId, Vec2>: UnwindSafe,
HashMap<NodeId, Spring2>: UnwindSafe,
HashMap<NodeId, Tween>: UnwindSafe,
RawVecInner: UnwindSafe,
Arc<str>: UnwindSafe,
NonNull<u8>: UnwindSafe,
HashMap<EdgeId, Tween>: UnwindSafe,
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
Source§type NoneType = T
type NoneType = T
The type of the none-equivalent value that
NoneValue::null_value produces.Source§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().