Merge pull request #146 from itrocks/svg-fixes

FIX SVGPath elliptical arc with rx/ry=0 + z should return to initial …
This commit is contained in:
Nicola Asuni 2020-02-12 11:11:40 +00:00 committed by GitHub
commit 91b3fde146
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23405,7 +23405,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
*/
protected function SVGPath($d, $style='') {
if ($this->state != 2) {
return;
return;
}
// set fill/stroke style
$op = TCPDF_STATIC::getPathPaintOperator($style, '');
@ -23425,6 +23425,8 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$xmax = 0;
$ymin = 2147483647;
$ymax = 0;
$xinitial = 0;
$yinitial = 0;
$relcoord = false;
$minlen = (0.01 / $this->k); // minimum acceptable length (3 point)
$firstcmd = true; // used to print first point
@ -23469,6 +23471,8 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
if ($ck == 1) {
$this->_outPoint($x, $y);
$firstcmd = false;
$xinitial = $x;
$yinitial = $y;
} else {
$this->_outLine($x, $y);
}
@ -23656,8 +23660,8 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
if ((($ck + 1) % 7) == 0) {
$x0 = $x;
$y0 = $y;
$rx = abs($params[($ck - 6)]);
$ry = abs($params[($ck - 5)]);
$rx = max(abs($params[($ck - 6)]), .000000001);
$ry = max(abs($params[($ck - 5)]), .000000001);
$ang = -$rawparams[($ck - 4)];
$angle = deg2rad($ang);
$fa = $rawparams[($ck - 3)]; // large-arc-flag
@ -23744,6 +23748,8 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
}
case 'Z': {
$this->_out('h');
$x = $x0 = $xinitial;
$y = $y0 = $yinitial;
break;
}
}