From 98188999aa0a83357c3311443e522a3c0e0ba82f Mon Sep 17 00:00:00 2001 From: Yevhenii Reizner Date: Sun, 3 Dec 2023 17:58:11 +0200 Subject: [PATCH] Simple refactoring. --- crates/resvg/src/path.rs | 12 ++++++------ crates/resvg/src/tree.rs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/resvg/src/path.rs b/crates/resvg/src/path.rs index be4839a8e..b28c7a64e 100644 --- a/crates/resvg/src/path.rs +++ b/crates/resvg/src/path.rs @@ -44,8 +44,8 @@ pub fn convert( let mut bboxes = BBoxes::default(); - if let Some((_, l_bbox, o_bbox)) = fill_path { - bboxes.layer = bboxes.layer.expand(l_bbox); + if let Some((_, o_bbox)) = fill_path { + bboxes.layer = bboxes.layer.expand(o_bbox); bboxes.object = bboxes.object.expand(o_bbox); } if let Some((_, l_bbox, o_bbox)) = stroke_path { @@ -60,7 +60,7 @@ pub fn convert( } if upath.paint_order == usvg::PaintOrder::FillAndStroke { - if let Some((path, _, _)) = fill_path { + if let Some((path, _)) = fill_path { children.push(Node::FillPath(path)); } @@ -72,7 +72,7 @@ pub fn convert( children.push(Node::StrokePath(path)); } - if let Some((path, _, _)) = fill_path { + if let Some((path, _)) = fill_path { children.push(Node::FillPath(path)); } } @@ -85,7 +85,7 @@ fn convert_fill_path( path: Rc, text_bbox: Option, anti_alias: bool, -) -> Option<(FillPath, usvg::BBox, usvg::BBox)> { +) -> Option<(FillPath, usvg::BBox)> { // Horizontal and vertical lines cannot be filled. Skip. if path.bounds().width() == 0.0 || path.bounds().height() == 0.0 { return None; @@ -111,7 +111,7 @@ fn convert_fill_path( path, }; - Some((path, object_bbox, object_bbox)) + Some((path, object_bbox)) } fn convert_stroke_path( diff --git a/crates/resvg/src/tree.rs b/crates/resvg/src/tree.rs index dee0a4231..ddd001602 100644 --- a/crates/resvg/src/tree.rs +++ b/crates/resvg/src/tree.rs @@ -17,7 +17,7 @@ pub struct Group { pub mask: Option, pub filters: Vec, pub isolate: bool, - /// Group's layer bounding box in canvas coordinates. + /// Group's layer bounding box in object coordinates. pub bbox: tiny_skia::Rect, pub children: Vec,