return((fabs(value) < DrawEpsilon) && (p == point) ? MagickFalse : MagickTrue);
}
-static size_t ReckonEllipseCoordinates(const PointInfo stop,
+static size_t ReckonEllipseCoordinates(const PointInfo radii,
const PointInfo degrees)
{
double
/*
Ellipses are just short segmented polys.
*/
- delta=2.0*PerceptibleReciprocal(MagickMax(stop.x,stop.y));
+ if ((fabs(radii.x) < MagickEpsilon) || (fabs(radii.y) < MagickEpsilon))
+ return(0);
+ delta=2.0*PerceptibleReciprocal(MagickMax(radii.x,radii.y));
step=MagickPI/8.0;
if ((delta >= 0.0) && (delta < (MagickPI/8.0)))
step=MagickPI/(4.0*(MagickPI*PerceptibleReciprocal(delta)/2.0));
}
static void TraceEllipse(PrimitiveInfo *primitive_info,const PointInfo start,
- const PointInfo stop,const PointInfo degrees)
+ const PointInfo radii,const PointInfo degrees)
{
double
delta,
/*
Ellipses are just short segmented polys.
*/
- delta=2.0*PerceptibleReciprocal(MagickMax(stop.x,stop.y));
+ primitive_info->coordinates=0;
+ if ((fabs(radii.x) < MagickEpsilon) || (fabs(radii.y) < MagickEpsilon))
+ return;
+ delta=2.0*PerceptibleReciprocal(MagickMax(radii.x,radii.y));
step=MagickPI/8.0;
if ((delta >= 0.0) && (delta < (MagickPI/8.0)))
step=MagickPI/(4.0*(MagickPI*PerceptibleReciprocal(delta)/2.0));
angle.y=DegreesToRadians(y);
for (p=primitive_info; angle.x < angle.y; angle.x+=step)
{
- point.x=cos(fmod(angle.x,DegreesToRadians(360.0)))*stop.x+start.x;
- point.y=sin(fmod(angle.x,DegreesToRadians(360.0)))*stop.y+start.y;
+ point.x=cos(fmod(angle.x,DegreesToRadians(360.0)))*radii.x+start.x;
+ point.y=sin(fmod(angle.x,DegreesToRadians(360.0)))*radii.y+start.y;
TracePoint(p,point);
p+=p->coordinates;
}
- point.x=cos(fmod(angle.y,DegreesToRadians(360.0)))*stop.x+start.x;
- point.y=sin(fmod(angle.y,DegreesToRadians(360.0)))*stop.y+start.y;
+ point.x=cos(fmod(angle.y,DegreesToRadians(360.0)))*radii.x+start.x;
+ point.y=sin(fmod(angle.y,DegreesToRadians(360.0)))*radii.y+start.y;
TracePoint(p,point);
p+=p->coordinates;
primitive_info->coordinates=(size_t) (p-primitive_info);
register ssize_t
i;
+ if ((fabs(start.x-end.x) < DrawEpsilon) ||
+ (fabs(start.y-end.y) < DrawEpsilon))
+ {
+ primitive_info->coordinates=0;
+ return;
+ }
p=primitive_info;
TracePoint(p,start);
p+=p->coordinates;
register ssize_t
i;
- p=primitive_info;
offset.x=fabs(end.x-start.x);
offset.y=fabs(end.y-start.y);
+ if ((offset.x < DrawEpsilon) || (offset.y < DrawEpsilon))
+ {
+ primitive_info->coordinates=0;
+ return;
+ }
+ p=primitive_info;
if (arc.x > (0.5*offset.x))
arc.x=0.5*offset.x;
if (arc.y > (0.5*offset.y))