summaryrefslogtreecommitdiff
path: root/src/Kind.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Kind.zig')
-rw-r--r--src/Kind.zig7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Kind.zig b/src/Kind.zig
index e5332831..241acf4b 100644
--- a/src/Kind.zig
+++ b/src/Kind.zig
@@ -366,7 +366,7 @@ pub fn paint(p: *const Pardes, slot: *Slot, id: usize, arena: std.mem.Allocator,
const cells = arena.alloc(c.pa_cell, @as(usize, cols) * rows) catch return null;
@memset(std.mem.sliceAsBytes(cells), 0);
var out: c.pa_paint = std.mem.zeroInit(c.pa_paint, .{ .placements = &frame.buf, .cap = frame.buf.len });
- const px = if (comptime pardes.pdf_enabled) p.cell_pixels else struct { w: u16 = 8, h: u16 = 16 }{};
+ const px = if (comptime pardes.pdf_enabled) p.view().cell_pixels else struct { w: u16 = 8, h: u16 = 16 }{};
const win = std.mem.zeroInit(c.pa_window, .{ .cells = cells.ptr, .stride = cols, .rows = rows, .cols = cols, .cell_w = px.w, .cell_h = px.h, .focused = @intFromBool(focusedAnywhere(p, id)) });
var cl: Call = .{ .p = null, .id = 0, .slot = slot, .quiet = true };
const prev = cl.begin("paint");
@@ -430,7 +430,7 @@ fn prefixOf(p: *const Pardes, slot: *const Slot, buf: *[400]u8) []const u8 {
var w: std.Io.Writer = .fixed(buf);
w.writeAll(if (own.len > 0) own else slot.nameOf()) catch {};
if (placed) w.print(" petscii:{s} palette:{t} ascii:{s}", .{
- if (slot.art.glyph or !p.frontend.native_images) "on" else "off",
+ if (slot.art.glyph or !p.view().frontend.native_images) "on" else "off",
slot.art.palette,
if (slot.art.ascii) "on" else "off",
}) catch {};
@@ -524,8 +524,7 @@ pub fn step(p: *Pardes) void {
/// Whether pane `id` has the keyboard in some view (its window focused).
fn focusedAnywhere(p: *const Pardes, id: usize) bool {
- if (p.active == id and p.window_focused) return true;
- for (p.parked, 0..) |v, k| if (v) |pv| if (k != p.view and views.isOpen(p, @intCast(k)) and pv.view.active == id and pv.view.window_focused) return true;
+ for (&p.views) |*v| if (v.*) |*vw| if (vw.active == id and vw.window_focused) return true;
return false;
}