From 933d42cfa1a896c6514e189b4b4e0a40a2a6c9f3 Mon Sep 17 00:00:00 2001 From: wp Date: Fri, 1 Jan 2016 23:41:11 +0000 Subject: [PATCH] fpvectorial: Fix incorrect exception that paths must begin with a MoveTo command. git-svn-id: trunk@51109 - --- components/fpvectorial/fpvutils.pas | 6 +++--- components/fpvectorial/svgvectorialreader.pas | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/fpvectorial/fpvutils.pas b/components/fpvectorial/fpvutils.pas index 49bae89dbb..c471c9d948 100644 --- a/components/fpvectorial/fpvutils.pas +++ b/components/fpvectorial/fpvutils.pas @@ -529,12 +529,12 @@ begin begin curSegment := TPathSegment(APath.Next); + if (i = 0) and (curSegment.SegmentType <> stMoveTo) then + raise Exception.Create('Path must start with a "MoveTo" command'); + case curSegment.SegmentType of stMoveTo: begin - if i <> 0 then - raise Exception.Create('Path must start with a "MoveTo" command'); - // Store current length of points array as polygon start index if numPolygons >= Length(PolygonStartIndexes) then SetLength(PolygonstartIndexes, Length(PolygonStartIndexes) + POINT_BUFFER); diff --git a/components/fpvectorial/svgvectorialreader.pas b/components/fpvectorial/svgvectorialreader.pas index e9546b644c..1305ab1eef 100644 --- a/components/fpvectorial/svgvectorialreader.pas +++ b/components/fpvectorial/svgvectorialreader.pas @@ -2403,7 +2403,7 @@ begin for i := 0 to ANode.Attributes.Length - 1 do begin lNodeName := ANode.Attributes.Item[i].NodeName; - if lNodeName = 'points' then + if lNodeName = 'points' then lPointsStr := ANode.Attributes.Item[i].NodeValue; end;