summaryrefslogtreecommitdiff
path: root/anim/src/cursor.zig
diff options
context:
space:
mode:
Diffstat (limited to 'anim/src/cursor.zig')
-rw-r--r--anim/src/cursor.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/anim/src/cursor.zig b/anim/src/cursor.zig
index 9de02c1..16ccd77 100644
--- a/anim/src/cursor.zig
+++ b/anim/src/cursor.zig
@@ -142,6 +142,8 @@ pub const Cursor = struct {
first: u64,
last: u64,
of: u32 = 0,
+ /// The stops the clock counts its way in (`journey`).
+ by: Recording.Stop = .moment,
/// A cursor at rest at moment `start`.
pub fn init(s: *anim.Frame, rec: *Recording, start: u64) Cursor {
@@ -238,6 +240,7 @@ pub const Cursor = struct {
/// what the head's progress line and step counter are measured against.
pub fn journey(c: *Cursor, by: Recording.Stop, until: u64) void {
c.last = until;
+ c.by = by;
c.of = c.steps(by, c.first, until);
}
@@ -403,6 +406,8 @@ pub const Cursor = struct {
// (the window gliding there, 24 f), then the pane fades through.
const fit = c.levels.source_rows;
const windows = [2]u32{ rec.shownFirst(fit, a), rec.shownFirst(fit, b) };
+ // In the column the map has of the file: `unroll`, the window's travel, `roll` (96 f).
+ if (@import("source.zig").inColumn(rec, a.src, windows, fit)) return time.unroll.grow + time.unroll.travel + time.unroll.roll;
if (@max(windows[0], windows[1]) - @min(windows[0], windows[1]) > fit) return 2 * time.move;
if (windows[0] != windows[1]) return time.move;
if (wave or jumps(rec, from, to)) return 2 * time.current_jump;