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 committed by Hermet Park
parent 548962f5f8
commit 5138a7c914

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. //FIXME: preserve the stroke width. too workaround, need a better design.
if (P(ctx.propagator)->rs.strokeWidth() > 0.0f) { if (P(ctx.propagator)->rs.strokeWidth() > 0.0f) {
ctx.propagator->strokeWidth(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->strokeWidth(ctx.propagator->strokeWidth() / denominator);
} }
} }