code=LineToCode;
if (coordinates <= 0)
{
+ /*
+ New subpath.
+ */
coordinates=(ssize_t) primitive_info[i].coordinates;
p=primitive_info[i].point;
start=n;
n++;
}
if (coordinates > 0)
- continue;
+ continue; /* next point in current subpath */
if (closed_subpath != MagickFalse)
{
closed_subpath=MagickFalse;
clip_mask=CloneImage(image,image->columns,image->rows,MagickTrue,exception);
if (clip_mask == (Image *) NULL)
return((Image *) NULL);
- (void) SetImageMask(clip_mask,ReadPixelMask,(Image *) NULL,exception);
(void) SetImageMask(clip_mask,WritePixelMask,(Image *) NULL,exception);
(void) QueryColorCompliance("#0000",AllCompliance,
&clip_mask->background_color,exception);
return(MagickFalse);
if (image->debug != MagickFalse)
(void) LogMagickEvent(DrawEvent,GetMagickModule(),"begin draw-image");
+ if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
+ return(MagickFalse);
primitive=(char *) NULL;
if (*draw_info->primitive != '@')
primitive=AcquireString(draw_info->primitive);
fill_rule=ParseCommandOption(MagickFillRuleOptions,MagickFalse,
token);
if (fill_rule == -1)
- status=MagickFalse;
- else
- graphic_context[n]->fill_rule=(FillRule) fill_rule;
+ {
+ status=MagickFalse;
+ break;
+ }
+ graphic_context[n]->fill_rule=(FillRule) fill_rule;
break;
}
if (LocaleCompare("clip-units",keyword) == 0)
decorate=ParseCommandOption(MagickDecorateOptions,MagickFalse,
token);
if (decorate == -1)
- status=MagickFalse;
- else
- graphic_context[n]->decorate=(DecorationType) decorate;
+ {
+ status=MagickFalse;
+ break;
+ }
+ graphic_context[n]->decorate=(DecorationType) decorate;
break;
}
if (LocaleCompare("density",keyword) == 0)
fill_rule=ParseCommandOption(MagickFillRuleOptions,MagickFalse,
token);
if (fill_rule == -1)
- status=MagickFalse;
- else
- graphic_context[n]->fill_rule=(FillRule) fill_rule;
+ {
+ status=MagickFalse;
+ break;
+ }
+ graphic_context[n]->fill_rule=(FillRule) fill_rule;
break;
}
if (LocaleCompare("font",keyword) == 0)
GetNextToken(q,&q,extent,token);
stretch=ParseCommandOption(MagickStretchOptions,MagickFalse,token);
if (stretch == -1)
- status=MagickFalse;
- else
- graphic_context[n]->stretch=(StretchType) stretch;
+ {
+ status=MagickFalse;
+ break;
+ }
+ graphic_context[n]->stretch=(StretchType) stretch;
break;
}
if (LocaleCompare("font-style",keyword) == 0)
GetNextToken(q,&q,extent,token);
style=ParseCommandOption(MagickStyleOptions,MagickFalse,token);
if (style == -1)
- status=MagickFalse;
- else
- graphic_context[n]->style=(StyleType) style;
+ {
+ status=MagickFalse;
+ break;
+ }
+ graphic_context[n]->style=(StyleType) style;
break;
}
if (LocaleCompare("font-weight",keyword) == 0)
GetNextToken(q,&q,extent,token);
gravity=ParseCommandOption(MagickGravityOptions,MagickFalse,token);
if (gravity == -1)
- status=MagickFalse;
- else
- graphic_context[n]->gravity=(GravityType) gravity;
+ {
+ status=MagickFalse;
+ break;
+ }
+ graphic_context[n]->gravity=(GravityType) gravity;
break;
}
status=MagickFalse;
GetNextToken(q,&q,extent,token);
compose=ParseCommandOption(MagickComposeOptions,MagickFalse,token);
if (compose == -1)
- status=MagickFalse;
- else
- graphic_context[n]->compose=(CompositeOperator) compose;
+ {
+ status=MagickFalse;
+ break;
+ }
+ graphic_context[n]->compose=(CompositeOperator) compose;
break;
}
if (LocaleCompare("interline-spacing",keyword) == 0)
name[MagickPathExtent];
RectangleInfo
- pattern_bounds;
+ bounds;
GetNextToken(q,&q,extent,token);
(void) CopyMagickString(name,token,MagickPathExtent);
GetNextToken(q,&q,extent,token);
- pattern_bounds.x=(ssize_t) ceil(StringToDouble(token,
- &next_token)-0.5);
+ bounds.x=(ssize_t) ceil(StringToDouble(token,&next_token)-0.5);
if (token == next_token)
ThrowPointExpectedException(token,exception);
GetNextToken(q,&q,extent,token);
if (*token == ',')
GetNextToken(q,&q,extent,token);
- pattern_bounds.y=(ssize_t) ceil(StringToDouble(token,
- &next_token)-0.5);
+ bounds.y=(ssize_t) ceil(StringToDouble(token,&next_token)-0.5);
if (token == next_token)
ThrowPointExpectedException(token,exception);
GetNextToken(q,&q,extent,token);
if (*token == ',')
GetNextToken(q,&q,extent,token);
- pattern_bounds.width=(size_t) floor(StringToDouble(token,
- &next_token)+0.5);
+ bounds.width=(size_t) floor(StringToDouble(token,&next_token)+
+ 0.5);
if (token == next_token)
ThrowPointExpectedException(token,exception);
GetNextToken(q,&q,extent,token);
if (*token == ',')
GetNextToken(q,&q,extent,token);
- pattern_bounds.height=(size_t) floor(StringToDouble(token,
- &next_token)+0.5);
+ bounds.height=(size_t) floor(StringToDouble(token,&next_token)+
+ 0.5);
if (token == next_token)
ThrowPointExpectedException(token,exception);
for (p=q; *q != '\0'; )
(void) FormatLocaleString(key,MagickPathExtent,"%s-geometry",
name);
(void) FormatLocaleString(geometry,MagickPathExtent,
- "%.20gx%.20g%+.20g%+.20g",(double)pattern_bounds.width,
- (double)pattern_bounds.height,(double)pattern_bounds.x,
- (double)pattern_bounds.y);
+ "%.20gx%.20g%+.20g%+.20g",(double)bounds.width,(double)
+ bounds.height,(double)bounds.x,(double) bounds.y);
(void) SetImageArtifact(image,key,geometry);
GetNextToken(q,&q,extent,token);
break;
GetNextToken(q,&q,extent,token);
align=ParseCommandOption(MagickAlignOptions,MagickFalse,token);
if (align == -1)
- status=MagickFalse;
- else
- graphic_context[n]->align=(AlignType) align;
+ {
+ status=MagickFalse;
+ break;
+ }
+ graphic_context[n]->align=(AlignType) align;
break;
}
if (LocaleCompare("text-anchor",keyword) == 0)
GetNextToken(q,&q,extent,token);
align=ParseCommandOption(MagickAlignOptions,MagickFalse,token);
if (align == -1)
- status=MagickFalse;
- else
- graphic_context[n]->align=(AlignType) align;
+ {
+ status=MagickFalse;
+ break;
+ }
+ graphic_context[n]->align=(AlignType) align;
break;
}
if (LocaleCompare("text-antialias",keyword) == 0)
status=MagickFalse;
break;
}
- coordinates=BezierQuantum*primitive_info[j].coordinates;
+ coordinates=(BezierQuantum*primitive_info[j].coordinates);
break;
}
case PathPrimitive:
GetNextToken(q,&q,extent,token);
method=ParseCommandOption(MagickMethodOptions,MagickFalse,token);
if (method == -1)
- status=MagickFalse;
- else
- primitive_info[j].method=(PaintMethod) method;
+ {
+ status=MagickFalse;
+ break;
+ }
+ primitive_info[j].method=(PaintMethod) method;
break;
}
case TextPrimitive:
exception=AcquireExceptionInfo();
(void) QueryColorCompliance("#000F",AllCompliance,&draw_info->fill,
exception);
- (void) QueryColorCompliance("#0000",AllCompliance,&draw_info->stroke,
+ (void) QueryColorCompliance("#FFF0",AllCompliance,&draw_info->stroke,
exception);
+ draw_info->stroke_antialias=clone_info->antialias;
draw_info->stroke_width=1.0;
draw_info->fill_rule=EvenOddRule;
draw_info->alpha=OpaqueAlpha;
draw_info->render=MagickTrue;
draw_info->clip_path=MagickFalse;
draw_info->debug=IsEventLogging();
- draw_info->stroke_antialias=clone_info->antialias;
if (clone_info->font != (char *) NULL)
draw_info->font=AcquireString(clone_info->font);
if (clone_info->density != (char *) NULL)
box_q[3].y)/(slope.p-slope.q));
box_q[4].y=(double) (slope.p*(box_q[4].x-box_q[0].x)+box_q[0].y);
}
- CheckPathExtent(6*BezierQuantum-360);
+ CheckPathExtent(6*BezierQuantum+360);
dot_product=dx.q*dy.p-dx.p*dy.q;
if (dot_product <= 0.0)
switch (draw_info->linejoin)
theta.q+=2.0*MagickPI;
arc_segments=(size_t) ceil((double) ((theta.q-theta.p)/
(2.0*sqrt((double) (1.0/mid)))));
- CheckPathExtent(arc_segments+6*BezierQuantum-360);
+ CheckPathExtent(arc_segments+6*BezierQuantum+360);
path_q[q].x=box_q[1].x;
path_q[q].y=box_q[1].y;
q++;
theta.p+=2.0*MagickPI;
arc_segments=(size_t) ceil((double) ((theta.p-theta.q)/
(2.0*sqrt((double) (1.0/mid)))));
- CheckPathExtent(arc_segments+6*BezierQuantum-360);
+ CheckPathExtent(arc_segments+6*BezierQuantum+360);
path_p[p++]=box_p[1];
for (j=1; j < (ssize_t) arc_segments; j++)
{