graphic_context[n]->clipping_mask=DrawClippingMask(image,
graphic_context[n],token,clip_path,exception);
if (draw_info->compliance != SVGCompliance)
- status&=DrawClipPath(image,graphic_context[n],
- graphic_context[n]->clip_mask,exception);
+ {
+ const char
+ *clip_path;
+
+ clip_path=(const char *) GetValueFromSplayTree(macros,
+ graphic_context[n]->clip_mask);
+ if (clip_path != (const char *) NULL)
+ (void) SetImageArtifact(image,
+ graphic_context[n]->clip_mask,clip_path);
+ status&=DrawClipPath(image,graphic_context[n],
+ graphic_context[n]->clip_mask,exception);
+ }
}
break;
}
}
if (LocaleCompare("clip-path",token) == 0)
{
- char
- name[MaxTextExtent];
-
- const char
- *clip_path;
-
GetNextToken(q,&q,extent,token);
- (void) FormatLocaleString(name,MaxTextExtent,"%s",token);
- clip_path=(const char *) GetValueFromSplayTree(macros,name);
- if (clip_path != (const char *) NULL)
- (void) SetImageArtifact(image,name,clip_path);
+ for (p=q; *q != '\0'; )
+ {
+ GetNextToken(q,&q,extent,token);
+ if (LocaleCompare(token,"pop") != 0)
+ continue;
+ GetNextToken(q,(const char **) NULL,extent,token);
+ if (LocaleCompare(token,"clip-path") != 0)
+ continue;
+ break;
+ }
+ if ((q == (char *) NULL) || (p == (char *) NULL) || ((q-4) < p))
+ {
+ status=MagickFalse;
+ break;
+ }
+ GetNextToken(q,&q,extent,token);
break;
}
if (LocaleCompare("defs",token) == 0)
(graphic_context[n]->clip_mask != (char *) NULL) &&
(LocaleCompare(graphic_context[n]->clip_mask,
graphic_context[n-1]->clip_mask) != 0))
- status&=DrawClipPath(image,graphic_context[n],
- graphic_context[n]->clip_mask,exception);
+ {
+ const char
+ *clip_path;
+
+ clip_path=(const char *) GetValueFromSplayTree(macros,
+ graphic_context[n]->clip_mask);
+ if (clip_path != (const char *) NULL)
+ (void) SetImageArtifact(image,graphic_context[n]->clip_mask,
+ clip_path);
+ status&=DrawClipPath(image,graphic_context[n],
+ graphic_context[n]->clip_mask,exception);
+ }
status&=DrawPrimitive(image,graphic_context[n],primitive_info,
exception);
}
static inline double ConstrainCoordinate(double x)
{
- if (x < -SSIZE_MAX)
- return(-SSIZE_MAX);
- if (x > SSIZE_MAX)
- return(SSIZE_MAX);
+ if (x < (double) -SSIZE_MAX)
+ return((double) -SSIZE_MAX);
+ if (x > (double) SSIZE_MAX)
+ return((double) SSIZE_MAX);
return(x);
}