mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Fix patterns with spacing in PDF (#3793)
This commit is contained in:
parent
eef3c3c5ff
commit
72c5b42a30
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user