diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-10 19:06:11 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-10 19:06:11 -0300 |
| commit | 13fe4003276daf884da4e29112fb4db8630ad46a (patch) | |
| tree | 2703d7230784f038c7f47f013d5907315d5a811f | |
| parent | e63b0624f57472d40af32a006c32cc47d403b822 (diff) | |
| download | computeranim-13fe4003276daf884da4e29112fb4db8630ad46a.tar.gz computeranim-13fe4003276daf884da4e29112fb4db8630ad46a.zip | |
canim: sort's swap plays in the whole frame
The camera's visit at x1.5 cleared the context and the lens's view, and
left the projection from the bytes starting at nothing.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
| -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); } |
