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:
Hermet Park 2023-09-20 18:29:19 +09:00
parent 74b67919e0
commit 7ec969be29

View file

@ -170,6 +170,11 @@ static void _updateTransform(LottieTransform* transform, int32_t frameNo, Render
auto pmatrix = PP(ctx.propagator)->transform();
ctx.propagator->transform(pmatrix ? mathMultiply(pmatrix, &matrix) : matrix);
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));
}
}