summaryrefslogtreecommitdiff
path: root/src/addon_test.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/addon_test.zig')
-rw-r--r--src/addon_test.zig9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/addon_test.zig b/src/addon_test.zig
index a4788109..427f0289 100644
--- a/src/addon_test.zig
+++ b/src/addon_test.zig
@@ -47,7 +47,9 @@ fn run(io: std.Io, gpa: std.mem.Allocator, lib: []const u8, script_path: ?[]cons
defer pardes.memory.deinit();
pardes.syntax.start(allocs.tree_sitter);
defer pardes.syntax.stop();
- const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 80, .rows = 24, .state = .memory, .image_allocator = allocs.image, .pdf_allocator = allocs.pdf, .tree_sitter_allocator = allocs.tree_sitter, .frame_allocator = allocs.frame });
+ // A terminal's view on every build: what a script prints is the same
+ // from a window's binary (a picture's raster is a view's, Kind.viewOf).
+ const p = try Pardes.init(gpa, .{ .tty_only = true, .windowed = false, .cols = 80, .rows = 24, .state = .memory, .image_allocator = allocs.image, .tree_sitter_allocator = allocs.tree_sitter, .frame_allocator = allocs.frame });
defer p.deinit();
// Loaded as `Addon load` loads it, the host's half here.
pardes.Addon.perform(p, .load, 0, lib);
@@ -218,6 +220,9 @@ fn show(p: *Pardes, gpa: std.mem.Allocator, id: usize, out: *std.Io.Writer, size
try out.print("|{s}\n", .{std.mem.trimEnd(u8, row.items, " ")});
}
for (s.placements.items) |pl| if (pl.pane == id) {
- try out.print("placement {d}x{d} src {d},{d} {d}x{d} over {d},{d} {d}x{d} key {x}\n", .{ pl.raster.w, pl.raster.h, pl.src.x, pl.src.y, pl.src.w, pl.src.h, pl.dst.x - r.x, pl.dst.y - r.y, pl.dst.w, pl.dst.h, pl.key });
+ try out.print("placement {d}x{d} src {d},{d} {d}x{d} over {d},{d} {d}x{d} key {x}", .{ pl.raster.w, pl.raster.h, pl.src.x, pl.src.y, pl.src.w, pl.src.h, pl.dst.x - r.x, pl.dst.y - r.y, pl.dst.w, pl.dst.h, pl.key });
+ if (pl.at) |at| try out.print(" at {d},{d} {d}x{d}", .{ at.x, at.y, at.w, at.h });
+ if (pl.dirty) |d| try out.print(" rows {d}+{d} of {x}", .{ d.y, d.h, d.from });
+ try out.writeAll("\n");
};
}