summaryrefslogtreecommitdiff
path: root/anim/scenes/heap.zig
diff options
context:
space:
mode:
Diffstat (limited to 'anim/scenes/heap.zig')
-rw-r--r--anim/scenes/heap.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/anim/scenes/heap.zig b/anim/scenes/heap.zig
index 544ae91..1f82766 100644
--- a/anim/scenes/heap.zig
+++ b/anim/scenes/heap.zig
@@ -220,7 +220,10 @@ const Lists = struct {
const shows: f32 = if (from == null) after(now, 0, 12) else if (to == null) 1 - after(now, 0, 12) else 1;
const nv = v.faded(shows);
const r: canim.Rect = .{ .x = xy[0], .y = xy[1], .w = w, .h = h };
- _ = nv.address(r.x + 16, r.y - 8, node, .{ .ink = ui.rgb(theme.color.region.heap) });
+ // On its way between the rows its address goes and comes back (the first and last quarter): it never passes over a pin's names.
+ const travels = s0.row != s1.row or s0.k != s1.k;
+ const label = if (travels) std.math.clamp(@max(1 - 4 * p, 4 * p - 3), 0, 1) else 1;
+ _ = nv.faded(label).address(r.x + 16, r.y - 8, node, .{ .ink = ui.rgb(theme.color.region.heap) });
// Nothing turns in a frame: a node that changes lists turns as it lands (its last 12 f),
// and its value and link, where they change and are not struck, crossfade with the idea (12 f).
const lands = after(now, 36, 12);
@@ -346,7 +349,7 @@ const Chunks = struct {
// The heap new in this step (the first malloc's): its rows come in, unmarked, over 12 f with memory's slot.
const new = !now.resting() and heapAt(f.scratch, c.cursor.rec, now.stops[1]) == null;
const comes: f32 = if (new) std.math.clamp(now.since(.memory, 0) / (12.0 / 60.0), 0, 1) else 1;
- canim.hexdump.fielded(.{ .u = v.u.faded(comes), .rows = v.rows, .box = v.box }, now, cm.tag + cm.pad, .{ .base = view_base, .len = view_len, .fields = fieldsAt(f.scratch, c.cursor.rec, now.stop(.memory)), .watched = if (new) 0 else std.math.maxInt(usize) });
+ canim.hexdump.fielded(.{ .u = v.u.faded(comes), .rows = v.rows, .box = v.box }, now, cm.tag + cm.pad, .{ .base = view_base, .len = view_len, .fields = fieldsAt(f.scratch, c.cursor.rec, now.stop(.memory)), .was = fieldsAt(f.scratch, c.cursor.rec, now.stops[1]), .watched = if (new) 0 else std.math.maxInt(usize), .pins = true });
v.veil(now);
}
};