Skip to content

PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust

Integration: #2977 number its hayro-interpret patch 46 (35 is #3296's)

aionggc3c0bea0a1fe
diff --git a/vendor/hayro-interpret/src/color.rs b/vendor/hayro-interpret/src/color.rs
index 2ae627b66..c95e31a17 100644
--- a/vendor/hayro-interpret/src/color.rs
+++ b/vendor/hayro-interpret/src/color.rs
@@ -1256,7 +1256,7 @@ pub struct Color {
}
impl Color {
- /// PdfCraft patch (35): the same colour, fully opaque (see `Pattern::without_opacity`).
+ /// PdfCraft patch (46): the same colour, fully opaque (see `Pattern::without_opacity`).
pub(crate) fn opaque(mut self) -> Self {
self.opacity = 1.0;
self
diff --git a/vendor/hayro-interpret/src/pattern.rs b/vendor/hayro-interpret/src/pattern.rs
index 38e654351..1b3e046c4 100644
--- a/vendor/hayro-interpret/src/pattern.rs
+++ b/vendor/hayro-interpret/src/pattern.rs
@@ -67,7 +67,7 @@ impl<'a> Pattern<'a> {
}
}
- /// PdfCraft patch (35): the pattern without the fill or stroke opacity it captured when it was
+ /// PdfCraft patch (46): the pattern without the fill or stroke opacity it captured when it was
/// set (`scn`). A stencil mask's transparency group applies the opacity in force when the mask
/// is drawn, so a pattern paint carrying it too drew the mask at the opacity squared (#2975).
pub(crate) fn without_opacity(mut self) -> Self {
diff --git a/vendor/hayro-interpret/src/x_object.rs b/vendor/hayro-interpret/src/x_object.rs
index 276531031..0665ba191 100644
--- a/vendor/hayro-interpret/src/x_object.rs
+++ b/vendor/hayro-interpret/src/x_object.rs
@@ -262,14 +262,14 @@ pub(crate) fn draw_image_xobject<'a, 'b>(
device.set_soft_mask(None);
device.set_blend_mode(BlendMode::default());
- // PdfCraft patch (35): the group just pushed applies the fill opacity, so a stencil mask's
+ // PdfCraft patch (46): the group just pushed applies the fill opacity, so a stencil mask's
// paint (the fill colour) must not carry it again: at `ca 0.5` a mask was drawn at a
// quarter of its opacity (#2975). The state is restored below.
context.get_mut().graphics_state.non_stroke_alpha = 1.0;
let image = if x_object.is_mask {
Image::Stencil(StencilImage {
- // A pattern paint keeps the opacity it was set with: drop it too (patch 35).
+ // A pattern paint keeps the opacity it was set with: drop it too (patch 46).
paint: match get_paint(context, false) {
Paint::Pattern(pattern) => Paint::Pattern(Box::new(pattern.without_opacity())),
paint => paint,