mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-20 15:03:25 +00:00
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:
parent
548962f5f8
commit
5138a7c914
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue