mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-23 22:58:44 +00:00
Merge a797516c70
into 15aafbfe62
This commit is contained in:
commit
7f9bacd517
1 changed files with 32 additions and 1 deletions
|
@ -201,7 +201,13 @@ bool LottieRoundnessModifier::modifyPath(PathCommand* inCmds, uint32_t inCmdsCnt
|
||||||
_roundCorner(path.cmds, path.pts, prev, curr, inPts[iPts + 5], r);
|
_roundCorner(path.cmds, path.pts, prev, curr, inPts[iPts + 5], r);
|
||||||
iPts += 3;
|
iPts += 3;
|
||||||
break;
|
break;
|
||||||
} else if (inCmds[iCmds + 1] == PathCommand::Close) {
|
}
|
||||||
|
if (inCmds[iCmds + 1] == PathCommand::LineTo) {
|
||||||
|
_roundCorner(path.cmds, path.pts, prev, curr, inPts[iPts + 3], r);
|
||||||
|
iPts += 3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (inCmds[iCmds + 1] == PathCommand::Close) {
|
||||||
_roundCorner(path.cmds, path.pts, prev, curr, inPts[2], r);
|
_roundCorner(path.cmds, path.pts, prev, curr, inPts[2], r);
|
||||||
path.pts[startIndex] = path.pts.last();
|
path.pts[startIndex] = path.pts.last();
|
||||||
iPts += 3;
|
iPts += 3;
|
||||||
|
@ -214,6 +220,31 @@ bool LottieRoundnessModifier::modifyPath(PathCommand* inCmds, uint32_t inCmdsCnt
|
||||||
path.pts.push(inPts[iPts++]);
|
path.pts.push(inPts[iPts++]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case PathCommand::LineTo: {
|
||||||
|
if (iCmds < inCmdsCnt - 1) {
|
||||||
|
auto& prev = inPts[iPts - 1];
|
||||||
|
auto& curr = inPts[iPts];
|
||||||
|
if (inCmds[iCmds + 1] == PathCommand::CubicTo && _colinear(inPts + iPts)) {
|
||||||
|
_roundCorner(path.cmds, path.pts, prev, curr, inPts[iPts + 3], r);
|
||||||
|
++iPts;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (inCmds[iCmds + 1] == PathCommand::LineTo) {
|
||||||
|
_roundCorner(path.cmds, path.pts, prev, curr, inPts[iPts + 1], r);
|
||||||
|
++iPts;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (inCmds[iCmds + 1] == PathCommand::Close) {
|
||||||
|
_roundCorner(path.cmds, path.pts, prev, curr, inPts[1], r);
|
||||||
|
path.pts[startIndex] = path.pts.last();
|
||||||
|
++iPts;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
path.cmds.push(PathCommand::LineTo);
|
||||||
|
path.pts.push(inPts[iPts++]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case PathCommand::Close: {
|
case PathCommand::Close: {
|
||||||
path.cmds.push(PathCommand::Close);
|
path.cmds.push(PathCommand::Close);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue