mirror of
https://github.com/tecnickcom/TCPDF.git
synced 2025-03-21 14:39:40 +01:00
FIX SVGPath elliptical arc with rx/ry=0 + z should return to initial point
(cherry picked from commit b00ecd6be852c95e699d0396f6ed4b2b54ad1e41)
This commit is contained in:
parent
9fde7bb9b4
commit
3637a35af4
12
tcpdf.php
12
tcpdf.php
@ -23406,7 +23406,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, '');
|
||||
@ -23426,6 +23426,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
|
||||
@ -23470,6 +23472,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);
|
||||
}
|
||||
@ -23657,8 +23661,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
|
||||
@ -23745,6 +23749,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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user