mirror of https://github.com/stelzo/typst.git
Do not upset Acrobat
This commit is contained in:
parent
b14274d1e4
commit
680cc9aa93
|
|
@ -223,6 +223,7 @@ impl<'a> PageContext<'a> {
|
|||
self.content.set_fill_color([f(c.r), f(c.g), f(c.b)]);
|
||||
}
|
||||
Color::Cmyk(c) => {
|
||||
self.reset_fill_color_space();
|
||||
self.content.set_fill_cmyk(f(c.c), f(c.m), f(c.y), f(c.k));
|
||||
}
|
||||
}
|
||||
|
|
@ -237,6 +238,10 @@ impl<'a> PageContext<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
fn reset_fill_color_space(&mut self) {
|
||||
self.state.fill_space = None;
|
||||
}
|
||||
|
||||
fn set_stroke(&mut self, stroke: Stroke) {
|
||||
if self.state.stroke != Some(stroke) {
|
||||
let f = |c| c as f32 / 255.0;
|
||||
|
|
@ -251,6 +256,7 @@ impl<'a> PageContext<'a> {
|
|||
self.content.set_stroke_color([f(c.r), f(c.g), f(c.b)]);
|
||||
}
|
||||
Color::Cmyk(c) => {
|
||||
self.reset_stroke_color_space();
|
||||
self.content.set_stroke_cmyk(f(c.c), f(c.m), f(c.y), f(c.k));
|
||||
}
|
||||
}
|
||||
|
|
@ -266,6 +272,10 @@ impl<'a> PageContext<'a> {
|
|||
self.state.stroke_space = Some(space);
|
||||
}
|
||||
}
|
||||
|
||||
fn reset_stroke_color_space(&mut self) {
|
||||
self.state.stroke_space = None;
|
||||
}
|
||||
}
|
||||
|
||||
/// Encode a frame into the content stream.
|
||||
|
|
|
|||
Loading…
Reference in New Issue