lottie/builder: hotfix, invalid stroking scaling.

There is a buggy workaround code that rewinds the stroke scaling.

Issue: https://github.com/thorvg/thorvg/issues/1730
This commit is contained in:
Hermet Park 2023-11-21 11:17:54 +09:00
parent ed9f46a1fc
commit 2e423e5c2a

View file

@ -194,7 +194,8 @@ static void _updateTransform(TVG_UNUSED LottieGroup* parent, LottieObject** chil
//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));
auto denominator = sqrtf(matrix.e11 * matrix.e11 + matrix.e12 * matrix.e12);
if (denominator > 1.0f) ctx.propagator->stroke(ctx.propagator->strokeWidth() / denominator);
}
}