mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-24 10:08:00 -06:00
Vendored
+1
-1
@@ -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
@@ -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
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user