summaryrefslogtreecommitdiff
path: root/anim/src/map.zig
diff options
context:
space:
mode:
Diffstat (limited to 'anim/src/map.zig')
-rw-r--r--anim/src/map.zig15
1 files changed, 14 insertions, 1 deletions
diff --git a/anim/src/map.zig b/anim/src/map.zig
index eaec991..2a2077a 100644
--- a/anim/src/map.zig
+++ b/anim/src/map.zig
@@ -1133,6 +1133,19 @@ fn spanOf2(maybe: ?Window, col: *const Column) ?[2]f32 {
/// The map whose columns the strips are (`context` sets it).
/// shortcut: process-wide, as the drawing flags are: one scene drawn at a time.
pub var current: ?*const Map = null;
+/// Every context's map (a scene in chapters has one a context, `context`): a
+/// pane's strip is drawn from its own context's, the one whose working
+/// frame has the pane's box; `current` where none has.
+pub var maps: [8]?*const Map = @splat(null);
+pub var maps_frame: u64 = std.math.maxInt(u64);
+
+fn ownMap(panel: Panel, at: anim.Placed, box: Rect) ?*const Map {
+ for (maps) |maybe| if (maybe) |m| {
+ const b = m.frame.box(at, @enumFromInt(@intFromEnum(panel)));
+ if (@abs(b.x - box.x) < 0.5 and @abs(b.y - box.y) < 0.5 and @abs(b.w - box.w) < 0.5 and @abs(b.h - box.h) < 0.5) return m;
+ };
+ return current;
+}
/// A mark no working window shows, `flash`ing on its pane's strip.
const Flash = struct { panel: Panel, key: u64, ink: u24, p: f32 };
@@ -1220,7 +1233,7 @@ fn stripRect(box: Rect) Rect {
/// pane fading through passes its faded one); drawn last, over its rows.
pub fn strip(panel: Panel, u: ui.Ui, box: Rect) void {
if (ui.mapping) return;
- const m = current orelse return;
+ const m = ownMap(panel, u.at, box) orelse return;
const f = u.f;
if (looking(f)) return;
const slot = slotOf(panel) orelse return;