diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-11 20:08:07 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-11 21:45:12 -0300 |
| commit | 15de88cf82c187635c1989e91bfa639a10304066 (patch) | |
| tree | 16fa83854258c0c6aec1dff7f70ebabf5fd64c09 /anim/src/words.zig | |
| parent | 0ec2376cae2fdfc50e90d930ebc86c7a5b7f5594 (diff) | |
| download | computeranim-15de88cf82c187635c1989e91bfa639a10304066.tar.gz computeranim-15de88cf82c187635c1989e91bfa639a10304066.zip | |
canim: a column of text as an experiment; the disassembly tied to the stack
From the user. A scene may set its text in a column beside the panes a
beat is about: col.beat names the panes and their rows, where the text
is placed (beside, below, above, or on a drawing) and what it is level
with; panes the beat leaves out fold to their title bars on a shelf,
their changes struck there. Tried as two scenes beside the originals:
the call followed down (column) and a bubble on sort's rings
(column_sort).
annotation = .tied names the word an instruction touched and draws a
touch to its stack row; offsets count from the frame's base; rsp's pin
travels with its amount before the stack follows; .whole keeps the full
chain. carry = .arrow draws a value's way between memory and a register.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
Diffstat (limited to 'anim/src/words.zig')
| -rw-r--r-- | anim/src/words.zig | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/anim/src/words.zig b/anim/src/words.zig index 5411385..6549dfb 100644 --- a/anim/src/words.zig +++ b/anim/src/words.zig @@ -24,17 +24,26 @@ pub const Clock = struct { box: Rect = .{ .x = theme.canvas.stage.x, .y = theme.canvas.clock_y - 12, .w = theme.canvas.stage.w, .h = 24 }, /// The map: with `CANIM_MAP`, drawn over everything (`Map.wholeMap`). map: ?*const @import("map.zig").Map = null, + /// The stage: in the column (`Stage.column`) the clock is under the text column alone. + stage: ?*const @import("stage.zig").Stage = null, pub fn draw(k: *const Clock, f: *sk.Frame, at: anim.Placed) void { const u = fixed(f, at, 0); const c = theme.canvas; const now = k.cursor.now(at); - const stage = c.stage; - // The margins are the page's, whatever the camera has brought under them. - u.fill(.{ .x = -c.width, .y = -c.height, .w = 3 * c.width, .h = c.height + stage.y }, theme.color.page); - u.fill(.{ .x = -c.width, .y = stage.y + stage.h, .w = 3 * c.width, .h = 2 * c.height }, theme.color.page); - u.fill(.{ .x = -c.width, .y = 0, .w = c.width + stage.x - 8, .h = c.height }, theme.color.page); - u.fill(.{ .x = stage.x + stage.w + 8, .y = 0, .w = c.width, .h = c.height }, theme.color.page); + const in_column = if (k.stage) |st| at.value(st.column) else 0; + const whole = c.stage; + // The margins are the page's, whatever the camera has brought under them + // (in the column the panes run on under the floor, 888 to 1032). + u.fill(.{ .x = -c.width, .y = -c.height, .w = 3 * c.width, .h = c.height + whole.y }, theme.color.page); + const floor_x: f32 = if (in_column > 0) theme.layout.state.x - c.gutter / 2 else -c.width; + u.fill(.{ .x = floor_x, .y = whole.y + whole.h, .w = 3 * c.width, .h = 2 * c.height }, theme.color.page); + u.fill(.{ .x = -c.width, .y = 0, .w = c.width + whole.x - 8, .h = c.height }, theme.color.page); + u.fill(.{ .x = whole.x + whole.w + 8, .y = 0, .w = c.width, .h = c.height }, theme.color.page); + // The rule: the stage's width, or the text column's. + var stage = whole; + stage.x = std.math.lerp(whole.x, theme.layout.state.x, theme.ease(.glide, in_column)); + stage.w = whole.x + whole.w - stage.x; u.fill(.{ .x = stage.x, .y = c.clock_y - 1, .w = stage.w, .h = theme.stroke.rule }, theme.color.rule); // Time itself: still while a step plays at a walk or a run; once its // mark has landed, the step's piece fades in (12 f, 8 at a run) and |
