diff options
Diffstat (limited to 'test/pdf.zig')
| -rw-r--r-- | test/pdf.zig | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/pdf.zig b/test/pdf.zig index d4efdfaf..5f7ebc52 100644 --- a/test/pdf.zig +++ b/test/pdf.zig @@ -774,6 +774,7 @@ test "MuPDF pane renders, navigates, searches, and round-trips its page" { .rows = 24, }); defer p.deinit(); + p.settings.motion = .off; // placements, not the glide (anim 11) const pane = p.panes[0].?; try std.testing.expect(hasPdf(pane)); try std.testing.expect(pane.pdf.?.page_count > 1); @@ -822,7 +823,7 @@ test "MuPDF pane renders, navigates, searches, and round-trips its page" { // SDL's raw dy path retains fractions in the placement itself; it does // not leave native pixels fixed while only the underlying cells slide. - p.update(.{ .pdf_scroll = .{ .pane = 0, .delta_pixels = 0.25 } }); + p.update(.{ .pdf_scroll = .{ .pane = 0, .delta_pixels = 0.25, .glide = false } }); try std.testing.expectEqual(@as(f64, 0.25), pane.pdf.?.document_scroll_y); _ = frame.reset(.retain_capacity); const fractional = try p.render(frame.allocator()); @@ -940,7 +941,7 @@ test "MuPDF pane renders, navigates, searches, and round-trips its page" { page0_revision, panes.Pdf.rasterForPage(&pane.pdf.?, 0).?.revision, ); - try std.testing.expect(panes.Pdf.scrollPane(p, pane, 1)); + try std.testing.expect(panes.Pdf.scrollPane(p, pane, 1, false)); try std.testing.expectEqual(@as(usize, 1), pane.pdf.?.page); try std.testing.expectEqual( page1_revision, @@ -1142,7 +1143,7 @@ test "a fling's banded pages show the reader exactly what whole pages would" { // is counted the way a wheel batch counts it. pv.document_scroll_y = 0; pv.scroll_travel = 0; - try std.testing.expect(panes.Pdf.scrollPane(p, pane, landing)); + try std.testing.expect(panes.Pdf.scrollPane(p, pane, landing, false)); _ = frame.reset(.retain_capacity); const flung = try p.render(frame.allocator()); try std.testing.expect(flung.nimages >= 2); @@ -1261,7 +1262,7 @@ test "a tall page is drawn at the display's resolution, in bands that are the wh defer gpa.free(middle); var middle_y: usize = 0; for ([_]f64{ 0, @round(max_scroll / 2), max_scroll }, 0..) |at, step| { - _ = panes.Pdf.scrollPane(p, pane, at - pv.document_scroll_y); + _ = panes.Pdf.scrollPane(p, pane, at - pv.document_scroll_y, false); pv.scroll_travel = 0; // read, not flung _ = frame.reset(.retain_capacity); const surface = try p.render(frame.allocator()); @@ -1291,7 +1292,7 @@ test "a tall page is drawn at the display's resolution, in bands that are the wh // Straight back to the middle from the foot: the rows rendered afresh // are the very rows rendered on the way down, so no seam moves with the // path a reader took. - _ = panes.Pdf.scrollPane(p, pane, @round(max_scroll / 2) - pv.document_scroll_y); + _ = panes.Pdf.scrollPane(p, pane, @round(max_scroll / 2) - pv.document_scroll_y, false); pv.scroll_travel = 0; _ = frame.reset(.retain_capacity); const again = (try p.render(frame.allocator())).images[0].?; @@ -1305,7 +1306,7 @@ test "a tall page is drawn at the display's resolution, in bands that are the wh middle[(common_top - middle_y) * stride .. (common_end - middle_y) * stride], again.rgba[(common_top - again_y) * stride .. (common_end - again_y) * stride], ); - _ = panes.Pdf.scrollPane(p, pane, max_scroll - pv.document_scroll_y); + _ = panes.Pdf.scrollPane(p, pane, max_scroll - pv.document_scroll_y, false); pv.scroll_travel = 0; _ = frame.reset(.retain_capacity); const foot = try gpa.dupe(u8, (try p.render(frame.allocator())).images[0].?.rgba); @@ -1663,6 +1664,7 @@ test "PDF tint and tinted theme changes rebuild every visible raster only" { .rows = 24, }); defer p.deinit(); + p.settings.motion = .off; // placements, not the glide (anim 11) const pane = p.panes[0].?; const pv = &pane.pdf.?; p.native_images = true; |
