Skip to content

Commit

Permalink
Fix resvg update: postprocess (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardy authored Jan 24, 2024
1 parent 87b6615 commit 0aa4345
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/kas-resvg/src/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ fn load(data: &[u8], resources_dir: Option<&Path>) -> Result<Tree, usvg::Error>
image_href_resolver: Default::default(),
};

Tree::from_data(data, &opts)
let mut tree = Tree::from_data(data, &opts)?;

// Postprocess. TODO: consider using usvg::Tree::postprocess instead:
// do we want to convert text to paths?
tree.calculate_abs_transforms();
tree.calculate_bounding_boxes();

Ok(tree)
}

#[derive(Clone)]
Expand Down

0 comments on commit 0aa4345

Please sign in to comment.