diff options
Diffstat (limited to 'anim/src/calls.zig')
| -rw-r--r-- | anim/src/calls.zig | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/anim/src/calls.zig b/anim/src/calls.zig index 0765ce4..5eef946 100644 --- a/anim/src/calls.zig +++ b/anim/src/calls.zig @@ -20,10 +20,6 @@ const time = theme.time; const Rect = ui.Rect; const t = theme.color.text; -/// A return's follow-through: its frame leaves the backtrace as the idea -/// strikes, and the tree's badge is struck this long after. -const badge_after = 0.20; - pub const Tree = struct { cursor: Cursor, stage: *const Stage, @@ -54,7 +50,7 @@ pub const Tree = struct { const top = body.y + m.root; const since = now.since(.idea, 0); const returned = now.walking() and rec.depths[now.stops[0]] < rec.depths[now.stops[1]]; - const moment = if (now.plan.gait == .sprint or since >= (if (returned) @as(f32, badge_after) else 0)) now.stops[0] else now.stops[1]; + const moment = if (now.plan.gait == .sprint or since >= (if (returned) @as(f32, time.badge_after) else 0)) now.stops[0] else now.stops[1]; const edge = cursors.standard(now.moving(.idea, time.quick, time.quick)); const appears = now.moving(.idea, 0, time.snap); const at_of = struct { @@ -124,7 +120,7 @@ pub const Tree = struct { if (active) continue; // Done: what it returned, on its shoulder; struck as it lands. const badge: Rect = .{ .x = c[0] + m.badge_at[0], .y = c[1] - m.badge_at[1], .w = m.badge, .h = m.badge }; - const heat: ui.Heat = if (n.call.exit.? > now.stops[1]) now.heat(0, null, since - badge_after) else .none; + const heat: ui.Heat = if (n.call.exit.? > now.stops[1]) now.heat(0, null, since - time.badge_after) else .none; const ink = u.cellWritten(badge, heat, theme.color.page); if (heat.level < 1) u.frame(badge, t.faint, theme.stroke.rule); u.label(ink.face, size, badge, .center, u.print("{d}", .{@as(i64, @bitCast(n.call.result))}), if (heat.level >= 1) ink.ink else ui.rgb(t.primary)); @@ -173,17 +169,8 @@ pub fn arguments(u: ui.Ui, rec: *const Recording, c: Recording.Call) []const u8 return u.print("{s}={d}", .{ name, @as(i64, @bitCast(arg)) }); } -/// The tree's measures (design/README.md, `calls`): a disc 48 across, -/// levels 46 apart, the root 48 under the tag; the result's square of 30 -/// on the shoulder, 12 right of the centre and 42 up; the caller's box. -const metric = struct { - const radius = 24; - const level = 46; - const root = 48; - const badge = 30; - const badge_at = [2]f32{ 12, 42 }; - const caller = [2]f32{ 64, 28 }; -}; +/// The tree's measures (design/README.md, `calls`): full size. +const metric = theme.metric.calls; pub const Node = struct { call: Recording.Call, |
