diff options
Diffstat (limited to 'anim/src/hexdump.zig')
| -rw-r--r-- | anim/src/hexdump.zig | 6 |
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; }, |
