diff options
Diffstat (limited to 'anim/scenes/sort.zig')
| -rw-r--r-- | anim/scenes/sort.zig | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/anim/scenes/sort.zig b/anim/scenes/sort.zig index 06b35a9..c9b5b07 100644 --- a/anim/scenes/sort.zig +++ b/anim/scenes/sort.zig @@ -47,24 +47,10 @@ fn frame(s: *anim.Frame) void { // The compare: both cells framed. It is the swap's anticipation. at.walk(s, .over, rec.next(.over, start)); says.line(s, "While the one on the left is larger, they trade places,\nand `j` follows the smaller value down."); - // Nearer, for the swap: the cells at x1.5, the rest of the stage cleared. - var cam: canim.Camera = .{}; - const others = .{ ctx.source, ctx.disasm, ctx.registers, ctx.stack }; - // The drawing's view is cleared with the rest (it is not the subject). - const going = s.cursor; - s.cursor = going + t.quick; - s.play(.{ctx.stage.view.to(0)}, .{ .seconds = t.camera_clear, .ease = anim.ease.linear }); - s.cursor = going; - cam.go(s, split.band, 1.5, others); - // Arcs: the two values fly past each other, one over, one under. + // Arcs: the two values fly past each other, one over, one under. The + // whole context stays: the swap is bytes changing, then cards moving. swap(at, s, rec); at.walk(s, .over, rec.next(.over, at.moment(s))); - const coming = s.cursor; - cam.back(s, others); - const back_at = s.cursor; - s.cursor = coming + t.camera; - s.play(.{ctx.stage.view.to(1)}, .{ .seconds = t.cascade, .ease = anim.ease.linear }); - s.cursor = @max(s.cursor, back_at); // Pacing: the same again, so at a run; then the long way 5 has to go, // at a sprint; slowing for the last swap. @@ -76,5 +62,4 @@ fn frame(s: *anim.Frame) void { at.walk(s, .over, end); says.line(s, "Nothing larger is left of 20. The array is sorted."); says.close(s); - cam.apply(s); } |
