diff options
Diffstat (limited to 'anim/src/words.zig')
| -rw-r--r-- | anim/src/words.zig | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/anim/src/words.zig b/anim/src/words.zig index ff9c5c1..5601156 100644 --- a/anim/src/words.zig +++ b/anim/src/words.zig @@ -36,7 +36,8 @@ pub const Clock = struct { u.fill(.{ .x = stage.x, .y = c.clock_y - 2, .w = stage.w * now.place, .h = 4 }, theme.mark(.current).solid); const size = theme.size.mono.context; const base = c.clock_y + 28; - const count = u.print("moment {d} of {d}", .{ now.stops[0] -| now.way[0], now.way[1] -| now.way[0] }); + // The count is where the current mark is: it changes as the mark moves on. + const count = u.print("moment {d} of {d}", .{ now.marked() -| now.way[0], now.way[1] -| now.way[0] }); const count_x = stage.x + stage.w - u.width(.mono, size, count); u.text(.mono, size, count_x, base, count, t.faint); // Secondary action: the pace, said quietly. It only fades. @@ -133,9 +134,9 @@ pub const Veil = struct { /// it means: the same in every picture. pub const Legend = struct { box: Rect, - entries: []const Entry = &.{ .current, .written, .changed, .read, .pointer, .allocated, .freed, .unknown, .kernel }, + entries: []const Entry = &.{ .current, .written, .changed, .read, .link, .allocated, .freed, .unknown, .kernel }, - pub const Entry = enum { current, written, changed, read, pointer, allocated, freed, unknown, kernel }; + pub const Entry = enum { current, written, changed, read, link, allocated, freed, unknown, kernel }; pub fn draw(l: *const Legend, f: *sk.Frame, at: anim.Placed) void { const u: ui.Ui = .{ .f = f, .at = at }; @@ -152,7 +153,7 @@ pub const Legend = struct { .written => .{ "written", "by this step" }, .changed => .{ "changed", "a moment ago" }, .read => .{ "read", "by this step" }, - .pointer => .{ "pointer", "holds an address" }, + .link => .{ "link", "now points at that" }, .allocated => .{ "allocated", "handed out" }, .freed => .{ "freed", "handed back" }, .unknown => .{ "not seen", "never observed" }, @@ -174,18 +175,14 @@ pub const Legend = struct { u.label(.mono_bold, size, r, .center, "rip", theme.mark(.current).on_solid); }, .written, .changed => for ([_]Rect{ half, other }, [_][]const u8{ "2a", "00" }) |cell, digits| { - const ink = u.written(cell, if (entry == .written) .{ .level = 1, .solid = 1 } else .ember, null); + const ink = u.cellWritten(cell, if (entry == .written) .{ .level = 1, .solid = 1 } else .ember, theme.color.raised); u.label(ink.face, size, cell, .center, digits, ink.ink); }, .read => for ([_]Rect{ half, other }, [_][]const u8{ "2a", "00" }) |cell, digits| { - u.readMark(cell, 1); + u.cellRead(cell, 1); u.label(.mono, size, cell, .center, digits, t.primary); }, - .pointer => { - u.fill(half, theme.color.raised); - u.frame(half, theme.mark(.pointer).solid, theme.stroke.arrow); - u.arrow(&.{ .{ r.x + 46, r.y + 23 }, .{ r.x + r.w, r.y + 23 } }, theme.mark(.pointer).solid, .{}); - }, + .link => u.route(&.{ .{ r.x, r.y + 23 }, .{ r.x + r.w, r.y + 23 } }, theme.color.region.heap, .{ .width = theme.stroke.tie.link, .head = .{ 10, 10 } }), .allocated => { u.fill(r, theme.mark(.allocated).ember); u.frame(r, theme.mark(.allocated).solid, theme.stroke.line); |
