From 1635d80290a48fddd4ae9f1de187e49cbd35f39b Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 4 Nov 2026 23:55:19 -0300 Subject: image: contain and its Fit, a wrapper over containGeometry kept for the window built without MuPDF, are gone: gui.zig's two places there (nativePlaceDrawable, the native image instance) ask containGeometry, null exactly when the old size was zero, and the contain test asserts on it Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/gui/gui.zig | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/gui') diff --git a/src/gui/gui.zig b/src/gui/gui.zig index 00491aeb..6a310635 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -6578,8 +6578,7 @@ fn nativePlaceGeometry(g: *const Gui, place: anytype) ?pardes.image.NativeGeomet fn nativePlaceDrawable(g: *const Gui, place: anytype) bool { if (comptime pardes.pdf_enabled) return nativePlaceGeometry(g, place) != null; const bounds = nativeBounds(g, place) orelse return false; - const fit = pardes.image.contain(place.iw, place.ih, bounds.w, bounds.h); - return fit.w != 0 and fit.h != 0; + return pardes.image.containGeometry(place.iw, place.ih, bounds.w, bounds.h) != null; } fn uploadNativeTexture( @@ -6717,8 +6716,7 @@ fn emitPreparedImage( }; } else { const bounds = nativeBounds(g, place) orelse return false; - const fit = pardes.image.contain(place.iw, place.ih, bounds.w, bounds.h); - if (fit.w == 0 or fit.h == 0) return false; + const fit = (pardes.image.containGeometry(place.iw, place.ih, bounds.w, bounds.h) orelse return false).dst; instance.* = .{ .x0 = (@as(f32, @floatFromInt(body_x)) / win_w) * 2.0 - 1.0, .y0 = 1.0 - (@as(f32, @floatFromInt(body_y)) / win_h) * 2.0, -- cgit v1.3