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/graph.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/graph.zig')
| -rw-r--r-- | anim/src/graph.zig | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/anim/src/graph.zig b/anim/src/graph.zig index 7066580..01b4ac7 100644 --- a/anim/src/graph.zig +++ b/anim/src/graph.zig @@ -1942,6 +1942,7 @@ fn drawPills(u: ui.Ui, v: Instant) void { } const o = u.faded(shows); const r: ui.Rect = .{ .x = x, .y = y, .w = n.w, .h = n.h }; + @import("ties.zig").anchor(u, .{ .block = n.start }, r); const base_y = rows.baseline(y); if (n.folded > 0) { pill(o, r, ui.rgb(theme.color.page), ui.rgb(theme.color.rule), theme.stroke.rule, true); @@ -2023,7 +2024,9 @@ pub const Blocks = struct { defer u.unclip(); const now = b.cursor.now(placed); const rule = theme.stroke.rule; - const room: [2]f32 = .{ box.w - 2 * rule, box.h - m.tag - rule }; + // Drawn larger (a column's drawing across both columns): laid out in its room at its own size, then scaled. + const z = placed.value(b.stage.zoom); + const room: [2]f32 = .{ (box.w - 2 * rule) / z, (box.h - m.tag - rule) / z }; const v = instant(f.scratch, now, b.form, room) orelse { _ = u.panel(box.w, box.h, "its blocks", .{ .focus = b.focus }); return; @@ -2033,8 +2036,11 @@ pub const Blocks = struct { const short = name[0 .. std.mem.lastIndexOfScalar(u8, name, '+') orelse name.len]; const title = if (std.mem.indexOfScalar(u8, full, '!')) |bang| u.print("the blocks of {s} \u{00b7} {s}", .{ short, full[0..bang] }) else u.print("the blocks of {s}", .{short}); _ = u.panel(box.w, box.h, title, .{ .focus = b.focus, .note = if (v.g.rings.len > 0) "its blocks \u{00b7} the visits so far \u{00b7} the path \u{00b7} the loops' turns" else "its blocks \u{00b7} the visits so far \u{00b7} the path" }); - u.clip(.{ .x = rule, .y = m.tag, .w = room[0], .h = room[1] }); - const o = u.moved(rule + v.at[0], m.tag + v.at[1]); + u.clip(.{ .x = rule, .y = m.tag, .w = room[0] * z, .h = room[1] * z }); + var big = u.moved(rule, m.tag); + big.at.xf = big.at.xf.mul(.scale(z, z)); + big.at.scale *= z; + const o = big.moved(v.at[0], v.at[1]); drawEdges(o, v); drawTurns(o, v); drawPills(o, v); |
