diff options
Diffstat (limited to 'anim/src/source.zig')
| -rw-r--r-- | anim/src/source.zig | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/anim/src/source.zig b/anim/src/source.zig index bbc985e..3843825 100644 --- a/anim/src/source.zig +++ b/anim/src/source.zig @@ -58,8 +58,18 @@ pub const Source = struct { const shown_first: u32 = @intFromFloat(windows[if (going >= 0.5) 1 else 0]); // Waiting: the pc is in code with no source, under this line's call. const waits = p.descent and !rec.sourced(now.marked()) and rec.own[now.marked()] != 0; - const note = if (waits) u.print("{s} waits at line {d} \u{00b7} the pc is in {s}", .{ context.frameName(u, rec, rec.register(firstOwn(rec, now.marked()), "rip")), rec.own[now.marked()], whereIs(u, rec, now.marked()) }) else if (rec.line_count > fit) u.print("lines {d} to {d} of {d}", .{ shown_first, @min(shown_first + fit - 1, rec.line_count), rec.line_count }) else u.print("{d} lines", .{rec.line_count}); - const body = u.panel(box.w, box.h, rec.file, .{ .focus = p.focus, .note = note }); + const lines_note = if (rec.line_count > fit) u.print("lines {d} to {d} of {d}", .{ shown_first, @min(shown_first + fit - 1, rec.line_count), rec.line_count }) else u.print("{d} lines", .{rec.line_count}); + // Where the pc is, said where it waits: a change of it (on through a + // stub) crossfades over the 12 f before the advance, never in a frame. + var notes: [2][]const u8 = undefined; + for (now.marks, ¬es) |mk, *note| note.* = if (p.descent and !rec.sourced(mk) and rec.own[mk] != 0) u.print("{s} waits at line {d} \u{00b7} the pc is in {s}", .{ context.frameName(u, rec, rec.register(firstOwn(rec, mk), "rip")), rec.own[mk], whereIs(u, rec, mk) }) else lines_note; + const swap = !std.mem.eql(u8, notes[0], notes[1]) and (notes[0].ptr != lines_note.ptr or notes[1].ptr != lines_note.ptr) and now.walking(); + const body = u.panel(box.w, box.h, rec.file, .{ .focus = p.focus, .note = if (swap) "" else if (waits) notes[if (going >= 0.5) 1 else 0] else lines_note }); + if (swap) { + const c = std.math.clamp((now.time - now.plan.advance + 12.0 / 60.0) / (12.0 / 60.0), 0, 1); + u.faded(1 - c).tagNote(box.w, notes[0]); + u.faded(c).tagNote(box.w, notes[1]); + } const top = body.y + m.pad; // Where the mark is, and how much of it. |
