mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-29 01:25:38 +00:00
Merge commit '53fa042a7f0a260eea017fff678c12c1d59cc0d4'
This commit is contained in:
commit
da0226624b
10
external/lunasvg/source/parser.cpp
vendored
10
external/lunasvg/source/parser.cpp
vendored
|
@ -176,7 +176,6 @@ Path Parser::parsePath(const std::string& string)
|
|||
double c[6];
|
||||
bool f[2];
|
||||
|
||||
int lastCommand = 0;
|
||||
Point startPoint;
|
||||
Point currentPoint;
|
||||
Point controlPoint;
|
||||
|
@ -259,8 +258,6 @@ Path Parser::parsePath(const std::string& string)
|
|||
break;
|
||||
case 'T':
|
||||
case 't':
|
||||
if(lastCommand != 'Q' && lastCommand != 'q' && lastCommand != 'T' && lastCommand != 't')
|
||||
controlPoint = currentPoint;
|
||||
c[0] = 2 * currentPoint.x - controlPoint.x;
|
||||
c[1] = 2 * currentPoint.y - controlPoint.y;
|
||||
if(!parseNumberList(ptr, end, c + 2, 2))
|
||||
|
@ -280,8 +277,6 @@ Path Parser::parsePath(const std::string& string)
|
|||
break;
|
||||
case 'S':
|
||||
case 's':
|
||||
if(lastCommand != 'C' && lastCommand != 'c' && lastCommand != 'S' && lastCommand != 's')
|
||||
controlPoint = currentPoint;
|
||||
c[0] = 2 * currentPoint.x - controlPoint.x;
|
||||
c[1] = 2 * currentPoint.y - controlPoint.y;
|
||||
if(!parseNumberList(ptr, end, c + 2, 4))
|
||||
|
@ -311,6 +306,7 @@ Path Parser::parsePath(const std::string& string)
|
|||
|
||||
path.lineTo(c[0], currentPoint.y);
|
||||
currentPoint.x = controlPoint.x = c[0];
|
||||
controlPoint.y = currentPoint.y;
|
||||
break;
|
||||
case 'V':
|
||||
case 'v':
|
||||
|
@ -321,6 +317,7 @@ Path Parser::parsePath(const std::string& string)
|
|||
c[1] += currentPoint.y;
|
||||
|
||||
path.lineTo(currentPoint.x, c[1]);
|
||||
controlPoint.x = currentPoint.x;
|
||||
currentPoint.y = controlPoint.y = c[1];
|
||||
break;
|
||||
case 'A':
|
||||
|
@ -356,10 +353,7 @@ Path Parser::parsePath(const std::string& string)
|
|||
break;
|
||||
|
||||
if(IS_ALPHA(*ptr))
|
||||
{
|
||||
lastCommand = command;
|
||||
command = *ptr++;
|
||||
}
|
||||
}
|
||||
|
||||
return path;
|
||||
|
|
Loading…
Reference in a new issue