diff options
author | Dom Lachowicz <domlachowicz@gmail.com> | 2007-06-16 14:48:37 +0000 |
---|---|---|
committer | Dom Lachowicz <doml@src.gnome.org> | 2007-06-16 14:48:37 +0000 |
commit | e77e87b4744a8f54d47781bda92db69fdba2dc65 (patch) | |
tree | 73be6b082d16edb16b6b8f2baff9c324601b62b3 /rsvg-structure.c | |
parent | baacfc1bfa63b7c73d6e0ac1654b50375bb47652 (diff) | |
download | librsvg-e77e87b4744a8f54d47781bda92db69fdba2dc65.tar.gz |
Bug 444462 - x & y attributes shouldn't affect the outermost <svg> element
2007-06-16 Dom Lachowicz <domlachowicz@gmail.com>
* rsvg-structure.c: Bug 444462 - x & y attributes shouldn't
affect the
outermost <svg> element
svn path=/trunk/; revision=1119
Diffstat (limited to 'rsvg-structure.c')
-rw-r--r-- | rsvg-structure.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/rsvg-structure.c b/rsvg-structure.c index f85a5269..0c5e62e8 100644 --- a/rsvg-structure.c +++ b/rsvg-structure.c @@ -87,6 +87,7 @@ _rsvg_node_dont_set_atts (RsvgNode * node, RsvgHandle * ctx, RsvgPropertyBag * a void _rsvg_node_init (RsvgNode * self) { + self->parent = NULL; self->children = g_ptr_array_new (); self->state = g_new (RsvgState, 1); rsvg_state_init (self->state); @@ -329,9 +330,14 @@ rsvg_node_svg_set_atts (RsvgNode * self, RsvgHandle * ctx, RsvgPropertyBag * att svg->w = _rsvg_css_parse_length (value); if ((value = rsvg_property_bag_lookup (atts, "height"))) svg->h = _rsvg_css_parse_length (value); - if ((value = rsvg_property_bag_lookup (atts, "x"))) + + /* + * x & y attributes have no effect on outermost svg + * http://www.w3.org/TR/SVG/struct.html#SVGElement + */ + if (self->parent && (value = rsvg_property_bag_lookup (atts, "x"))) svg->x = _rsvg_css_parse_length (value); - if ((value = rsvg_property_bag_lookup (atts, "y"))) + if (self->parent && (value = rsvg_property_bag_lookup (atts, "y"))) svg->y = _rsvg_css_parse_length (value); if ((value = rsvg_property_bag_lookup (atts, "class"))) klazz = value; |