diff options
Diffstat (limited to 'anim/src/ties.zig')
| -rw-r--r-- | anim/src/ties.zig | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/anim/src/ties.zig b/anim/src/ties.zig index d3a9ec7..e25c34b 100644 --- a/anim/src/ties.zig +++ b/anim/src/ties.zig @@ -139,7 +139,11 @@ pub fn pinShows(now: cursors.Now, i: usize, target: enum { slot, node }) struct if (now.registerAge(i) != 0) return .{ .old = 1, .new = 1 }; if (now.resting()) return .{ .old = 0, .new = 1 }; const since = linkSince(now, i); - if (!now.walking()) return if (since >= 0) .{ .old = 0, .new = 1 } else .{ .old = 1, .new = 0 }; + // At a run the pin changes with the run's ease (8 f), never in a frame. + if (!now.walking()) { + const p = std.math.clamp(since / time.run_ease, 0, 1); + return .{ .old = 1 - p, .new = p }; + } const l = time.link; const arrives = l.after + linkTime(if (target == .slot) .slot else .node); return .{ @@ -180,8 +184,9 @@ pub const Ties = struct { defer stack_window = null; defer thread_waits = false; const now = g.cursor.now(at); - // Diving or surfacing, the panels are on their way: no ties. + // Diving or surfacing, the panels are on their way: no ties; nor while the map alone is looked at. for (@import("context.zig").zoomed) |z| if (z != null) return; + if (@import("map.zig").looking(f)) return; // In canvas pixels, `k` of them a unit: places come from panels anywhere. var raw: ui.Ui = .{ .f = f, .at = at }; raw.at.xf = .identity; |
