summaryrefslogtreecommitdiff
path: root/anim/src/hexdump.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-12 04:45:57 -0300
committerGabriel Schneider <[email protected]>2026-11-12 07:03:05 -0300
commit4907e35bc45d12102d0e09380994814fc2e0a369 (patch)
tree7cfd90224653d73b63fbadaf2881fa0e6ba92860 /anim/src/hexdump.zig
parentebdebe04a76f0302aeb24c1ac08fa9217b1a8257 (diff)
downloadcomputeranim-4907e35bc45d12102d0e09380994814fc2e0a369.tar.gz
computeranim-4907e35bc45d12102d0e09380994814fc2e0a369.zip
canim: the introduction, from the review
The introduction records the plain build (clang -O0, no instrumentation), so reverse's frame is the compiler's own push, mov and sub. The stack chapter says its convention once and keeps four free words over rsp so a push moves the pin and nothing else; reverse's rows stand under main's and are stepped, each touching its word, the call before the push, the aim drawn head first to the row it returns to. The close-up frames the bytes and the stack together with their 128 bytes marked. Nothing is named before it is shown; offsets are written in hex as the operands are; the dump folds into its tag; the map is announced before it is shown. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
Diffstat (limited to 'anim/src/hexdump.zig')
-rw-r--r--anim/src/hexdump.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/anim/src/hexdump.zig b/anim/src/hexdump.zig
index 9b39bf6..d1c363c 100644
--- a/anim/src/hexdump.zig
+++ b/anim/src/hexdump.zig
@@ -801,8 +801,10 @@ pub fn readingIn(u: ui.Ui, y: f32, shift: f32, moment: Recording.Moment, values:
var word: u64 = 0;
for (0..@min(len, 8)) |k| word |= @as(u64, bytes[k]) << @intCast(8 * k);
if (word == 0) break :blk "NULL";
- if (x + theme.metric.context.arrow_w + @as(f32, @floatFromInt(ui.digits(word))) * adv > room) break :blk "\u{2026}";
- x = u.arrow(x, y + m.row / 2, .points);
+ // The arrow has its own room, as in a chain: no character before it.
+ const ax = if (x > b.reading + shift) x - adv else x;
+ if (ax + theme.metric.context.arrow_w + @as(f32, @floatFromInt(ui.digits(word))) * adv > room) break :blk "\u{2026}";
+ x = u.arrow(ax, y + m.row / 2, .points);
x = u.address(x, base, word, .{ .ink = ui.rgb(rows.ink(rows.regionOf(moment, word))) }) + adv;
continue;
},