Skip to content

Commit

Permalink
Support indirect SMasks
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmuizel committed Nov 23, 2023
1 parent db3a490 commit 379647e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1214,11 +1214,11 @@ pub struct MediaBox {
pub ury: f64
}

fn apply_state(gs: &mut GraphicsState, state: &Dictionary) {
fn apply_state(doc: &Document, gs: &mut GraphicsState, state: &Dictionary) {
for (k, v) in state.iter() {
let k : &[u8] = k.as_ref();
match k {
b"SMask" => { match v {
b"SMask" => { match maybe_deref(doc, v) {
&Object::Name(ref name) => {
if name == b"None" {
gs.smask = None;
Expand Down Expand Up @@ -1668,7 +1668,7 @@ impl<'a> Processor<'a> {
let ext_gstate: &Dictionary = get(doc, resources, b"ExtGState");
let name = operation.operands[0].as_name().unwrap();
let state: &Dictionary = get(doc, ext_gstate, name);
apply_state(&mut gs, state);
apply_state(doc, &mut gs, state);
}
"i" => { dlog!("unhandled graphics state flattness operator {:?}", operation); }
"w" => { gs.line_width = as_num(&operation.operands[0]); }
Expand Down

0 comments on commit 379647e

Please sign in to comment.