[librsvg: 4/5] Rect::make_shape - dedup function call




commit de12b10701aa95eb46f68c51356a730f9b3ad4dc
Author: Federico Mena Quintero <federico gnome org>
Date:   Mon Jul 12 13:14:34 2021 -0500

    Rect::make_shape - dedup function call
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/570>

 src/shapes.rs | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/shapes.rs b/src/shapes.rs
index 17cb79df..aee7dc4d 100644
--- a/src/shapes.rs
+++ b/src/shapes.rs
@@ -513,7 +513,6 @@ impl BasicShape for Rect {
             builder.line_to(x + w, y + h);
             builder.line_to(x, y + h);
             builder.line_to(x, y);
-            builder.close_path();
         } else {
             /* Hard case, rounded corners
              *
@@ -608,10 +607,10 @@ impl BasicShape for Rect {
                 top_x1,
                 top_y,
             );
-
-            builder.close_path();
         }
 
+        builder.close_path();
+
         ShapeDef::new(Rc::new(builder.into_path()), Markers::No)
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]