[librsvg] render correctly no width and height specification SVG.



commit e07a6d01f722a083cb16abc0225dadb1a7c0ff3e
Author: Hiroyuki Ikezoe <poincare ikezoe net>
Date:   Mon Apr 5 19:41:53 2010 +0900

    render correctly no width and height specification SVG.
    
    Fix for bug 612951 and bug 614018.
    
    Should use viewBox width and height if these values is in there.
    
    Width and height should be 100% by default. Do not reset those
    variables to -1 even if they are not specified.

 rsvg-base.c      |    2 +-
 rsvg-structure.c |    8 --------
 2 files changed, 1 insertions(+), 9 deletions(-)
---
diff --git a/rsvg-base.c b/rsvg-base.c
index bcb28d1..fb99d54 100644
--- a/rsvg-base.c
+++ b/rsvg-base.c
@@ -1347,7 +1347,7 @@ rsvg_handle_get_dimensions_sub (RsvgHandle * handle, RsvgDimensionData * dimensi
     bbox.w = bbox.h = 1;
 
     if (!id && (root->w.factor == 'p' || root->h.factor == 'p')
-	    && root->vbox.active && root->vbox.w > 0. && root->vbox.h > 0.)
+	    && !root->vbox.active)
 	handle_subelement = TRUE;
     else if (!id && root->w.length != -1 && root->h.length != -1)
 	handle_subelement = FALSE;
diff --git a/rsvg-structure.c b/rsvg-structure.c
index 4841494..3d8c9af 100644
--- a/rsvg-structure.c
+++ b/rsvg-structure.c
@@ -345,16 +345,8 @@ rsvg_node_svg_set_atts (RsvgNode * self, RsvgHandle * ctx, RsvgPropertyBag * att
             svg->preserve_aspect_ratio = rsvg_css_parse_aspect_ratio (value);
         if ((value = rsvg_property_bag_lookup (atts, "width")))
             svg->w = _rsvg_css_parse_length (value);
-	else {
-	    svg->w.length = -1;
-	    svg->w.factor = '\0';
-	}
         if ((value = rsvg_property_bag_lookup (atts, "height")))
             svg->h = _rsvg_css_parse_length (value);
-	else {
-	    svg->h.length = -1;
-	    svg->h.factor = '\0';
-	}
 		/* 
 		 * x & y attributes have no effect on outermost svg
 		 * http://www.w3.org/TR/SVG/struct.html#SVGElement 



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