Commit e07a6d01 authored by Hiroyuki Ikezoe's avatar Hiroyuki Ikezoe

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.
parent 06743754
......@@ -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;
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment