mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
lottie: fix offset with miter join
One point was skipped during the creation of the offset corner. The error was not visible because the point lies on the line, but it will become apparent if further modifiers are applied to the object (not supported now).
This commit is contained in:
parent
60f0f4cbe4
commit
27e78095ff
1 changed files with 5 additions and 2 deletions
|
@ -121,9 +121,12 @@ void LottieOffsetModifier::corner(RenderPath& out, Line& line, Line& nextLine, u
|
|||
auto norm = normal(line.pt1, line.pt2);
|
||||
auto nextNorm = normal(nextLine.pt1, nextLine.pt2);
|
||||
auto miterDirection = (norm + nextNorm) / length(norm + nextNorm);
|
||||
if (1.0f <= miterLimit * fabsf(miterDirection.x * norm.x + miterDirection.y * norm.y)) {
|
||||
out.cmds.push(PathCommand::LineTo);
|
||||
if (1.0f <= miterLimit * fabsf(miterDirection.x * norm.x + miterDirection.y * norm.y)) out.pts.push(intersect);
|
||||
else out.pts.push(nextLine.pt1);
|
||||
out.pts.push(intersect);
|
||||
}
|
||||
out.cmds.push(PathCommand::LineTo);
|
||||
out.pts.push(nextLine.pt1);
|
||||
} else {
|
||||
out.cmds.push(PathCommand::LineTo);
|
||||
out.pts.push(nextLine.pt1);
|
||||
|
|
Loading…
Add table
Reference in a new issue