mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-27 00:26:51 +00:00
lottie/builder: Fix incorrect stroke width scaling propagation.
The transform (scale) should be applied to the following drawing elements, not the previous stroke.
This commit is contained in:
parent
74b67919e0
commit
7ec969be29
1 changed files with 5 additions and 0 deletions
|
@ -170,6 +170,11 @@ static void _updateTransform(LottieTransform* transform, int32_t frameNo, Render
|
||||||
auto pmatrix = PP(ctx.propagator)->transform();
|
auto pmatrix = PP(ctx.propagator)->transform();
|
||||||
ctx.propagator->transform(pmatrix ? mathMultiply(pmatrix, &matrix) : matrix);
|
ctx.propagator->transform(pmatrix ? mathMultiply(pmatrix, &matrix) : matrix);
|
||||||
ctx.propagator->opacity(MULTIPLY(opacity, PP(ctx.propagator)->opacity));
|
ctx.propagator->opacity(MULTIPLY(opacity, PP(ctx.propagator)->opacity));
|
||||||
|
|
||||||
|
//FIXME: preserve the stroke width. too workaround, need a better design.
|
||||||
|
if (P(ctx.propagator)->rs.strokeWidth() > 0.0f) {
|
||||||
|
ctx.propagator->stroke(P(ctx.propagator)->rs.strokeWidth() / sqrt(matrix.e11 * matrix.e11 + matrix.e12 * matrix.e12));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue