Commit b0924de4 authored by Caleb Michael Moore's avatar Caleb Michael Moore

fixed bug 161467

parent 31c5c2db
......@@ -301,7 +301,7 @@ rsvg_linear_gradient_set_atts (RsvgNode * self, RsvgHandle *ctx, RsvgPropertyBag
grad->hasspread = TRUE;
}
if ((value = rsvg_property_bag_lookup (atts, "xlink:href")))
grad->fallback = rsvg_defs_lookup(ctx->defs, value);
rsvg_defs_add_resolver (ctx->defs, &grad->fallback, value);
if ((value = rsvg_property_bag_lookup (atts, "gradientTransform"))){
rsvg_parse_transform (grad->affine, value);
grad->hastransform = TRUE;
......@@ -374,7 +374,7 @@ rsvg_radial_gradient_set_atts (RsvgNode * self, RsvgHandle *ctx, RsvgPropertyBag
grad->hasfy = TRUE;
}
if ((value = rsvg_property_bag_lookup (atts, "xlink:href")))
grad->fallback = rsvg_defs_lookup(ctx->defs, value);
rsvg_defs_add_resolver (ctx->defs, &grad->fallback, value);
if ((value = rsvg_property_bag_lookup (atts, "gradientTransform"))){
rsvg_parse_transform (grad->affine, value);
grad->hastransform = TRUE;
......@@ -461,7 +461,7 @@ rsvg_pattern_set_atts (RsvgNode * self, RsvgHandle *ctx, RsvgPropertyBag *atts)
pattern->hasheight = TRUE;
}
if ((value = rsvg_property_bag_lookup (atts, "xlink:href")))
pattern->fallback = (RsvgPattern *)rsvg_defs_lookup(ctx->defs, value);
rsvg_defs_add_resolver (ctx->defs, (RsvgNode **)&pattern->fallback, value);
if ((value = rsvg_property_bag_lookup (atts, "patternTransform"))){
rsvg_parse_transform (pattern->affine, value);
pattern->hastransform = TRUE;
......
......@@ -240,7 +240,10 @@ rsvg_node_svg_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
rsvg_add_clipping_rect(ctx, sself->x, sself->y, sself->w, sself->h);
state = rsvg_state_current (ctx);
if (!sself->hasw)
sself->w = sself->vbw;
if (!sself->hash)
sself->h = sself->vbh;
if (sself->has_vbox)
{
affine[0] = sself->w / sself->vbw;
......@@ -303,12 +306,14 @@ rsvg_node_svg_set_atts (RsvgNode * self, RsvgHandle *ctx, RsvgPropertyBag *atts)
if ((value = rsvg_property_bag_lookup (atts, "width")))
{
svg->w = rsvg_css_parse_normalized_length (value, ctx->dpi_x, ctx->width, 1);
svg->hasw = TRUE;
if (!svg->has_vbox)
ctx->width = svg->w;
}
if ((value = rsvg_property_bag_lookup (atts, "height")))
{
svg->h = rsvg_css_parse_normalized_length (value, ctx->dpi_y, ctx->height, 1);
svg->hash = TRUE;
if (!svg->has_vbox)
ctx->height = svg->h;
}
......@@ -334,6 +339,7 @@ rsvg_new_svg (void)
svg->has_vbox = FALSE;
svg->preserve_aspect_ratio = RSVG_ASPECT_RATIO_XMID_YMID;
svg->x = 0; svg->y = 0; svg->w = -1; svg->h = -1;
svg->hasw = svg->hash = FALSE;
svg->vbx = 0; svg->vby = 0; svg->vbw = 0; svg->vbh = 0;
svg->super.children = g_ptr_array_new();
svg->super.state = g_new(RsvgState, 1);
......
......@@ -68,6 +68,8 @@ struct _RsvgNodeSvg {
RsvgNode super;
gint preserve_aspect_ratio;
gdouble x, y, w, h;
int hasw :1;
int hash :1;
gdouble vbx, vby, vbw, vbh;
gboolean overflow, has_vbox;
GdkPixbuf *img;
......
......@@ -597,7 +597,6 @@ rsvg_end_element (void *data, const xmlChar *name)
!strcmp ((char *)name, "conicalGradient") ||
!strcmp ((char *)name, "stop"))
{
printf ("ended %s\n", (char *)name);
rsvg_pop_def_group(ctx);
}
else if (!strncmp ((char *)name, "fe", 2) &&
......
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