Skip to main content

Module motion

Module motion 

Source
Expand description

F6 Arc 动效(方案 docs/flow/arc-flow-plan.md 第 7 节)。本地设计。

画布直接用 canvas 绘制边与端口,没法挂 GPUI 的 with_transition,所以这里把每个场景 做成以时间为输入的纯状态机:画布每帧用 motion_now 取样,有动画在跑就请求下一帧。 时长、缓动、弹簧全部取自 arc-tokens,求解器来自 arc-motion。

场景实现
拖拽松手落位拖拽中节点跟手(偏移 = 指针位置 − 吸附位置,不做动画),松手后偏移以 spring.responsive 归零
新增 / 删除节点缩放 0.96→1 + 透明度,ease.enter / duration.standard;删除留残影,ease.exit / duration.exit
新建连线按弧长绘入 0→1,ease.standard / duration.standard
连线吸附目标端口以 spring.snappy 放大,并有一圈光晕在 duration.considered 内淡出
非法连接目标端口水平抖动,duration.fast 关键帧
运行中边虚线沿边流动(自行切段,见 core::dash_polyline)
执行高亮Running 节点边框呼吸(NodeRenderCtx::pulse)
适配视图 / 键盘与按钮缩放视口以 spring.smooth 过渡:中心线性插值、缩放按对数插值

reduced motion:位移、视口、绘入、抖动、放大全部瞬时;进出场只保留 duration.instant 的透明度; 虚线不流动,边框不呼吸。

Structs§

Appear
进出场的取样:缩放与不透明度。
FlowMotion
Ghost
删除后仍在淡出的节点。

Constants§

NODE_ENTER_SCALE
节点进场起始缩放、退场结束缩放。