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

This commit is contained in:
aiongg
2026-10-22 01:48:40 +00:00
parent 1ddbb5f3ff
commit c3c0bea0a1
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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 {
+2 -2
View File
@@ -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,