summaryrefslogtreecommitdiff
path: root/anim/src/source.zig
diff options
context:
space:
mode:
Diffstat (limited to 'anim/src/source.zig')
-rw-r--r--anim/src/source.zig18
1 files changed, 9 insertions, 9 deletions
diff --git a/anim/src/source.zig b/anim/src/source.zig
index 6b693a4..301e8cd 100644
--- a/anim/src/source.zig
+++ b/anim/src/source.zig
@@ -42,10 +42,10 @@ pub const Source = struct {
// moves on) gliding to where the next one does. It never cuts.
const going = now.advancing();
const windows = [2]f32{ @floatFromInt(rec.viewFirst(fit, was)), @floatFromInt(rec.viewFirst(fit, here)) };
- // Further than two windows (a large file, another function far
- // off): what leaves has left before what replaces it arrives; a
- // scroll through thousands of lines would be a blur, and say nothing.
- const far = @abs(windows[1] - windows[0]) > 2 * @as(f32, @floatFromInt(fit));
+ // Farther than its own height (another function far off): what
+ // leaves has left before what replaces it arrives; a scroll of more
+ // lines than the window shows would be a blur, and say nothing.
+ const far = @abs(windows[1] - windows[0]) > @as(f32, @floatFromInt(fit));
const first = if (far) windows[if (going >= 0.5) 1 else 0] else std.math.lerp(windows[0], windows[1], cursors.glide(going));
const lit = if (far and going < 1) u.faded(@abs(2 * going - 1)) else u;
const from: u32 = @intFromFloat(@floor(first));
@@ -61,14 +61,14 @@ pub const Source = struct {
var mark_at: f32 = @floatFromInt(here);
var shows: f32 = 1;
if (going < 1) {
- if (!cursors.jumps(rec, now.marks[0], now.marks[1])) {
+ if (!now.plan.wave and !cursors.jumps(rec, now.marks[0], now.marks[1])) {
// A line near by: it slides, off promptly and settling on
// the next. The step's follow-through.
mark_at = std.math.lerp(@as(f32, @floatFromInt(was)), mark_at, cursors.standard(going));
if (@abs(mark_at - @as(f32, @floatFromInt(was))) < 0.5) mark_line = was;
} else {
- // A call, a return, a line far off: a jump. Out there, then
- // in here; it does not cross the lines between.
+ // A call, a return, a line far off, a continue: a jump. Out
+ // there, then in here; it does not cross the lines between.
const half = @min(theme.time.current_jump, travel / 2);
if (moved < travel - half) {
mark_line = was;
@@ -78,8 +78,8 @@ pub const Source = struct {
}
}
const mark_y = top + (mark_at - first) * m.row;
- // The numbers of the two windows, as wide as the widest needs.
- const widen = rows.numberRoom(@min(@as(u32, @intFromFloat(@max(windows[0], windows[1]))) + @as(u32, @intCast(context.rowsOf(box))), rec.line_count));
+ // The numbers as wide as the program's largest: a scroll does not shift the text.
+ const widen = rows.numberRoom(rec.line_count);
context.clipBody(u, box);
defer u.unclip();
// The plaque over the number. Fire: on the line about to run its