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.zig12
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);