diff options
Diffstat (limited to 'anim/src/rows.zig')
| -rw-r--r-- | anim/src/rows.zig | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/anim/src/rows.zig b/anim/src/rows.zig index a125b05..95400be 100644 --- a/anim/src/rows.zig +++ b/anim/src/rows.zig @@ -56,6 +56,9 @@ pub const Marks = struct { extend: ?f32 = null, /// The first hop's `lead` (a column of addresses). lead: usize = 0, + /// How much the hops after the first show: they fade out as the memory + /// they read is about to change (`Now.following`). + hops: f32 = 1, }; /// `chain` of a memory access narrower than a word: its address, then what @@ -119,7 +122,8 @@ pub fn chain(u: ui.Ui, x: f32, y: f32, moment: Recording.Moment, value: u64, roo const shown = ui.Value.of(link.value, pointer); const w = shown.width(); // The hops after a struck first one are followed again, one at a time. - const v = if (i > 0 and marks.extend != null) u.faded(std.math.clamp((marks.extend.? - @as(f32, @floatFromInt(i - 1)) * theme.time.unroll) / (6.0 / 60.0), 0, 1)) else u; + const followed: f32 = if (marks.extend) |e| std.math.clamp((e - @as(f32, @floatFromInt(i -| 1)) * theme.time.unroll) / (6.0 / 60.0), 0, 1) else 1; + const v = if (i > 0) u.faded(followed * marks.hops) else u; if (i > 0) { const named: f32 = if (link.region == .code and link.text.len > 0 and !link.string) 10 + @as(f32, @floatFromInt(link.text.len)) * adv else 0; // Room for it, and for saying there is more. |
