From b7eb31674e01c992cafc91518e161258b921bd33 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 08:26:42 -0300 Subject: A pane's ctl read says Collapse and a PDF's PdfFit and PdfTint (`collapsed`, `fit:height tint:full`), and a Dump keeps the PDF's two Neither showed in the tag or the ctl, and a Restore brought a PDF back at width fit and the default tint. The ctl read ends with `collapsed` when it is, and a PDF's `fit:` and `tint:` in the words PdfFit and PdfTint take; the dump's image record carries pdf_fit and pdf_tint (empty in older dumps: the defaults). Co-Authored-By: Claude Opus 5.5 --- src/dump.zig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/dump.zig') diff --git a/src/dump.zig b/src/dump.zig index 1420ea8f..84321457 100644 --- a/src/dump.zig +++ b/src/dump.zig @@ -247,6 +247,10 @@ pub const Image = struct { petscii: bool = false, palette: ImagePalette = .commodore, ascii: bool = true, + /// A PDF's PdfFit and PdfTint, by their tag words (`width`, `filtered`); + /// empty, the defaults, as in dumps from before. + pdf_fit: []const u8 = "", + pdf_tint: []const u8 = "", }; pub const Pane = struct { @@ -961,6 +965,10 @@ fn initDump(gpa: std.mem.Allocator, opts: Options, zon_bytes: []const u8, previo if (pardes.panes.Pdf.openPane(p, i, im.path, src.scroll + 1, .last) catch null) |restored| { if (raw.len > 0) gpa.free(raw); raw = &.{}; + // Its fit and tint as they were (PdfFit, PdfTint). + const pv = &restored.pdf.?; + if (std.meta.stringToEnum(@TypeOf(pv.fit), im.pdf_fit)) |fit| if (fit != pv.fit) pardes.panes.Pdf.toggleFit(restored); + if (std.meta.stringToEnum(@TypeOf(pv.tint), im.pdf_tint)) |tint| while (pv.tint != tint) pardes.panes.Pdf.toggleTint(restored); restored.cols = @max(1, src.cols); restored.rows = @max(1, src.rows); break :restore_image restored; -- cgit v1.3