[librsvg] structure.rs: Factor out some duplicated code



commit 7fd11755ee0d148bd5caa4c26ed8c4b91c6df52a
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Sep 27 08:47:50 2017 -0500

    structure.rs: Factor out some duplicated code

 rust/src/structure.rs |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
---
diff --git a/rust/src/structure.rs b/rust/src/structure.rs
index c52ff75..c443049 100644
--- a/rust/src/structure.rs
+++ b/rust/src/structure.rs
@@ -276,16 +276,11 @@ impl NodeTrait for NodeUse {
 
         // width or height set to 0 disables rendering of the element
         // https://www.w3.org/TR/SVG/struct.html#UseElementWidthAttribute
-        if double_equals (nw, 0.0) {
+        if double_equals (nw, 0.0) || double_equals (nh, 0.0) {
             drawing_ctx::release_node (draw_ctx, raw_child);
             return;
         }
         
-        if double_equals (nh, 0.0) {
-            drawing_ctx::release_node (draw_ctx, raw_child);
-            return;
-        }
-
         drawing_ctx::state_reinherit_top (draw_ctx, node.get_state (), dominate);
 
         let state = drawing_ctx::get_current_state (draw_ctx);
@@ -337,7 +332,6 @@ impl NodeTrait for NodeUse {
 
                 drawing_ctx::state_pop (draw_ctx);
                 drawing_ctx::pop_discrete_layer (draw_ctx);
-
                 drawing_ctx::pop_view_box (draw_ctx);
             });
         }


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