From 19ed0e39087370e51ea852557bedab7adf23f284 Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 16 Feb 2018 08:20:31 -0500 Subject: [PATCH] ... --- MagickCore/draw.c | 54 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/MagickCore/draw.c b/MagickCore/draw.c index cd48710e1..32b0aa6fc 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -5549,7 +5549,7 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) arc; /* - Compute arc points. + Elliptical arc. */ do { @@ -5597,7 +5597,7 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) case 'C': { /* - Compute bezier points. + Cubic Bézier curve. */ do { @@ -5621,6 +5621,10 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) TraceBezier(q,4); q+=q->coordinates; point=end; + while (isspace((int) ((unsigned char) *p)) != 0) + p++; + if (*p == ',') + p++; } while (IsPoint(p) != MagickFalse); break; } @@ -5636,12 +5640,19 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) point.x=(double) (attribute == (int) 'H' ? x: point.x+x); TracePoint(q,point); q+=q->coordinates; + while (isspace((int) ((unsigned char) *p)) != 0) + p++; + if (*p == ',') + p++; } while (IsPoint(p) != MagickFalse); break; } case 'l': case 'L': { + /* + Line to. + */ do { GetNextToken(p,&p,MagickPathExtent,token); @@ -5656,12 +5667,19 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) point.y=(double) (attribute == (int) 'L' ? y : point.y+y); TracePoint(q,point); q+=q->coordinates; + while (isspace((int) ((unsigned char) *p)) != 0) + p++; + if (*p == ',') + p++; } while (IsPoint(p) != MagickFalse); break; } case 'M': case 'm': { + /* + Move to; + */ if (q != primitive_info) { primitive_info->coordinates=(size_t) (q-primitive_info); @@ -5691,6 +5709,10 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) TracePoint(q,point); q+=q->coordinates; } + while (isspace((int) ((unsigned char) *p)) != 0) + p++; + if (*p == ',') + p++; } while (IsPoint(p) != MagickFalse); break; } @@ -5698,7 +5720,7 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) case 'Q': { /* - Compute bezier points. + Quadratic Bézier curve. */ do { @@ -5724,6 +5746,10 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) TraceBezier(q,3); q+=q->coordinates; point=end; + while (isspace((int) ((unsigned char) *p)) != 0) + p++; + if (*p == ',') + p++; } while (IsPoint(p) != MagickFalse); break; } @@ -5731,7 +5757,7 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) case 'S': { /* - Compute bezier points. + Cubic Bézier curve. */ do { @@ -5764,6 +5790,10 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) TraceBezier(q,4); q+=q->coordinates; point=end; + while (isspace((int) ((unsigned char) *p)) != 0) + p++; + if (*p == ',') + p++; } while (IsPoint(p) != MagickFalse); break; } @@ -5771,7 +5801,7 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) case 'T': { /* - Compute bezier points. + Quadratic Bézier curve. */ do { @@ -5802,12 +5832,19 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) TraceBezier(q,3); q+=q->coordinates; point=end; + while (isspace((int) ((unsigned char) *p)) != 0) + p++; + if (*p == ',') + p++; } while (IsPoint(p) != MagickFalse); break; } case 'v': case 'V': { + /* + Line to. + */ do { GetNextToken(p,&p,MagickPathExtent,token); @@ -5817,12 +5854,19 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path) point.y=(double) (attribute == (int) 'V' ? y : point.y+y); TracePoint(q,point); q+=q->coordinates; + while (isspace((int) ((unsigned char) *p)) != 0) + p++; + if (*p == ',') + p++; } while (IsPoint(p) != MagickFalse); break; } case 'z': case 'Z': { + /* + Close path. + */ point=start; TracePoint(q,point); q+=q->coordinates; -- 2.40.0