mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-19 11:01:08 +00:00
Fix reflecting relative quadratic curves after absolute quadratic curves.
This commit is contained in:
parent
aee62cb047
commit
cf344c2ba7
1 changed files with 3 additions and 14 deletions
|
|
@ -130,8 +130,6 @@
|
|||
controlY = 0, // current control point y
|
||||
tempX,
|
||||
tempY,
|
||||
tempControlX,
|
||||
tempControlY,
|
||||
l = -this.pathOffset.x,
|
||||
t = -this.pathOffset.y;
|
||||
|
||||
|
|
@ -343,20 +341,12 @@
|
|||
controlX = x;
|
||||
controlY = y;
|
||||
}
|
||||
else if (previous[0] === 't') {
|
||||
// calculate reflection of previous control points for t
|
||||
controlX = 2 * x - tempControlX;
|
||||
controlY = 2 * y - tempControlY;
|
||||
}
|
||||
else if (previous[0] === 'q') {
|
||||
// calculate reflection of previous control points for q
|
||||
else {
|
||||
// calculate reflection of previous control point
|
||||
controlX = 2 * x - controlX;
|
||||
controlY = 2 * y - controlY;
|
||||
}
|
||||
|
||||
tempControlX = controlX;
|
||||
tempControlY = controlY;
|
||||
|
||||
ctx.quadraticCurveTo(
|
||||
controlX + l,
|
||||
controlY + t,
|
||||
|
|
@ -830,8 +820,7 @@
|
|||
);
|
||||
x = tempX;
|
||||
y = tempY;
|
||||
controlX = x + current[1];
|
||||
controlY = y + current[2];
|
||||
|
||||
break;
|
||||
|
||||
case 'T':
|
||||
|
|
|
|||
Loading…
Reference in a new issue