diff options
Diffstat (limited to 'anim/src/ties.zig')
| -rw-r--r-- | anim/src/ties.zig | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/anim/src/ties.zig b/anim/src/ties.zig index 0df8e34..323cecf 100644 --- a/anim/src/ties.zig +++ b/anim/src/ties.zig @@ -85,14 +85,15 @@ var said: usize = 0; /// `r` (in `u`'s units) is where `place` is, this frame. pub fn anchor(u: ui.Ui, place: Place, r: Rect) void { - if (said == table.len) return; + if (said == table.len or ui.mapping) return; const a = u.at.xf.apply(.{ r.x, r.y }); const b = u.at.xf.apply(.{ r.x + r.w, r.y + r.h }); table[said] = .{ .key = place.key(), .box = .{ a[0], a[1], b[0], b[1] } }; said += 1; } -fn find(place: Place) ?[4]f32 { +/// Where `place` is this frame, in canvas pixels (left, top, right, bottom), if a panel said. +pub fn find(place: Place) ?[4]f32 { for (table[0..said]) |entry| if (entry.key == place.key()) return entry.box; return null; } @@ -175,6 +176,8 @@ pub const Ties = struct { defer said = 0; defer stack_window = null; const now = g.cursor.now(at); + // Diving or surfacing, the panels are on their way: no ties. + for (@import("context.zig").zoomed) |z| if (z != null) return; // In canvas pixels, `k` of them a unit: places come from panels anywhere. var raw: ui.Ui = .{ .f = f, .at = at }; raw.at.xf = .identity; @@ -317,7 +320,7 @@ pub const Ties = struct { const tie = [2]f32{ theme.metric.bracket.tie[0] * k, theme.metric.bracket.tie[1] * k }; // The bracket takes the row: x 7 of the dump, the row's height; // on the stack, the panel's left padding. - const bx = if (stacked) run[0] - (theme.metric.slot.chain - 5) * k else run[0] - (rows.byteX(@intCast(word % 16)) - 4 - theme.metric.bytes.bracket) * k; + const bx = if (stacked) run[0] - (theme.metric.slot.address - 5) * k else run[0] - (rows.byteX(@intCast(word % 16)) - 4 - theme.metric.bytes.bracket) * k; v.faded(bracket).bracket(bx, run[1] + 2 * k, run[3] - 2 * k, color, tie, 1, false); const cx = (over[0] + over[2]) / 2; const y = (run[1] + run[3]) / 2; |
