diff options
Diffstat (limited to 'anim/src/descent.zig')
| -rw-r--r-- | anim/src/descent.zig | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/anim/src/descent.zig b/anim/src/descent.zig index 3394eaa..d435b59 100644 --- a/anim/src/descent.zig +++ b/anim/src/descent.zig @@ -107,11 +107,19 @@ pub const Descent = struct { const room = theme.layout.rowsIn(box.h); const before = layout(u, rec, now.stops[1], room, d.root); const after = layout(u, rec, now.stops[0], room, d.root); + // On the map its box is as long as the rows it has wanted: not 69 for a function of 30. + if (ui.mapping) map.measure(.disasm, @max(before.items.len, after.items.len)); const tm = now.time; const going = now.advancing(); const kind: enum { same, down, through, up } = if (now.resting() or now.stops[0] == now.stops[1]) .same else if (after.windows > before.windows) (if (before.in_stub) .through else .down) else if (after.windows < before.windows) .up else .same; const shown = if (going >= 0.5) after else before; - const body = u.panel(box.w, box.h, "disassembly", .{ .focus = d.focus, .note = shown.tag }); + // A tag that changes with the advance crossfades over it. + const retag = !std.mem.eql(u8, before.tag, after.tag); + const body = u.panel(box.w, box.h, "disassembly", .{ .focus = d.focus, .note = if (retag) "" else shown.tag }); + if (retag) { + u.faded(1 - going).tagNote(box.w, before.tag); + u.faded(going).tagNote(box.w, after.tag); + } const top = body.y + m.pad; u.clip(.{ .x = theme.stroke.rule, .y = m.tag, .w = box.w - 2 * theme.stroke.rule, .h = box.h - m.tag - theme.stroke.rule }); defer u.unclip(); @@ -328,7 +336,7 @@ pub const Descent = struct { const yb = p.y + m.row / 2; u.route(&.{ .{ 14, ya }, .{ 14, yb }, .{ c.address - 4, yb } }, t.primary, .{ .width = theme.stroke.rule, .head = .{ 7, 8 }, .radius = 4, .progress = cursors.standard(drawn) }); } - map.window(.disasm, first(shown), last(shown)); + map.window(.disasm, .{ first(after), last(after) }, .{ first(before), last(before) }, cursors.glide(going)); if (pc_y[1] orelse pc_y[0]) |y| ties.anchor(u, .pc, .{ .x = 0, .y = y, .w = theme.metric.plaque.pc, .h = m.row }); kernel(u, now, box, under orelse top + @as(f32, @floatFromInt(room -| 3)) * m.row, pc_y[0] orelse pc_y[1]); context.veiled(u, box, now.veil); |
