diff --git a/crates/typst-pdf/src/pattern.rs b/crates/typst-pdf/src/pattern.rs index 0829ef32d..6dfb0f666 100644 --- a/crates/typst-pdf/src/pattern.rs +++ b/crates/typst-pdf/src/pattern.rs @@ -73,7 +73,9 @@ pub(crate) fn write_patterns(ctx: &mut PdfContext) { resources_map.finish(); tiling_pattern .matrix(transform_to_array( - transform.pre_concat(Transform::scale(Ratio::one(), -Ratio::one())), + transform + .pre_concat(Transform::scale(Ratio::one(), -Ratio::one())) + .post_concat(Transform::translate(Abs::zero(), pattern.spacing().y)), )) .filter(Filter::FlateDecode); } @@ -82,7 +84,7 @@ pub(crate) fn write_patterns(ctx: &mut PdfContext) { /// A pattern and its transform. #[derive(Clone, PartialEq, Eq, Hash)] pub struct PdfPattern { - /// The transform to apply to the gradient. + /// The transform to apply to the pattern. pub transform: Transform, /// The pattern to paint. pub pattern: Pattern,