summaryrefslogtreecommitdiff
path: root/anim/src/graph.zig
diff options
context:
space:
mode:
Diffstat (limited to 'anim/src/graph.zig')
-rw-r--r--anim/src/graph.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/anim/src/graph.zig b/anim/src/graph.zig
index 01b4ac7..9eb6f2d 100644
--- a/anim/src/graph.zig
+++ b/anim/src/graph.zig
@@ -2035,7 +2035,11 @@ pub const Blocks = struct {
const name = ui.symbol(u, full);
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" });
+ const 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.panel(box.w, box.h, title, .{ .focus = b.focus });
+ // Its labels stay inside its box at every size: the note fades where it no longer fits beside the title.
+ const need = 28 + u.width(.sans_medium, theme.size.sans.tag, title) + 24 + u.width(.sans, theme.size.sans.micro, note) + 10;
+ u.faded(std.math.clamp((box.w - need) / 48, 0, 1)).tagNote(box.w, note);
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));