summaryrefslogtreecommitdiff
path: root/anim/src/segments.zig
diff options
context:
space:
mode:
Diffstat (limited to 'anim/src/segments.zig')
-rw-r--r--anim/src/segments.zig14
1 files changed, 12 insertions, 2 deletions
diff --git a/anim/src/segments.zig b/anim/src/segments.zig
index db9d28f..a304993 100644
--- a/anim/src/segments.zig
+++ b/anim/src/segments.zig
@@ -572,6 +572,10 @@ pub const Place = struct {
/// Frames into the tie (negative: not begun); frames into its quieting.
clock: anim.Value,
quiet: anim.Value,
+ /// 0 to 1: the dump's place marked on its box for a camera's visit (it
+ /// is far thinner than a unit there): a 2-unit tick across the box in
+ /// the stack's ink, `128 bytes` over it, left of where the link comes down.
+ tick: ?anim.Value = null,
pub fn draw(p: *const Place, f: *sk.Frame, placed: anim.Placed) void {
const clock = placed.value(p.clock);
@@ -590,9 +594,15 @@ pub const Place = struct {
u.route(&.{ .{ p.x, p.y0 }, .{ p.x, top }, .{ to[0], top }, .{ to[0], to[1] } }, ink, .{ .width = theme.stroke.tie.link, .head = .{ 10, 10 }, .progress = drawn, .radius = 8 });
// The stack's band framed bright as the head lands.
const bright = std.math.clamp((clock - 42) / 6, 0, 1) * (1 - std.math.clamp((clock - 48) / 12, 0, 1));
- if (bright > 0) for (l.space.clusters, 0..) |c, i| if (i < 6 and p.addr >= c.lo and p.addr < c.hi) {
+ const marked = if (p.tick) |tv| std.math.clamp(placed.value(tv), 0, 1) else 0;
+ if (bright > 0 or marked > 0) for (l.space.clusters, 0..) |c, i| if (i < 6 and p.addr >= c.lo and p.addr < c.hi) {
const b = l.boxes[i];
- u.faded(bright).frame(.{ .x = b.x - 5, .y = b.y - 5, .w = b.w + 10, .h = b.h + 10 }, t.bright, theme.stroke.line);
+ if (bright > 0) u.faded(bright).frame(.{ .x = b.x - 5, .y = b.y - 5, .w = b.w + 10, .h = b.h + 10 }, t.bright, theme.stroke.line);
+ if (marked > 0) {
+ const label = "128 bytes";
+ u.faded(marked).fill(.{ .x = b.x, .y = to[1] - 1, .w = b.w, .h = 2 }, region.stack);
+ u.faded(marked).text(.sans, theme.size.sans.tag, to[0] - 8 - u.width(.sans, theme.size.sans.tag, label), to[1] - 6, label, region.stack);
+ }
};
}
};