mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
lottie: handle edge case for rounded rect
For rounded rectangles the roundness value should be determined using to the formula: r = min(r, max(size.x, size.y)/2) rather than the previous method: r = min(size.x/2, size.y/2, r)
This commit is contained in:
parent
5ae556cf13
commit
e50bf002de
1 changed files with 2 additions and 5 deletions
|
@ -472,10 +472,7 @@ void LottieBuilder::updateRect(LottieGroup* parent, LottieObject** child, float
|
|||
auto roundness = rect->radius(frameNo, exps);
|
||||
if (ctx->roundness > roundness) roundness = ctx->roundness;
|
||||
|
||||
if (roundness > ROUNDNESS_EPSILON) {
|
||||
if (roundness > size.x * 0.5f) roundness = size.x * 0.5f;
|
||||
if (roundness > size.y * 0.5f) roundness = size.y * 0.5f;
|
||||
}
|
||||
if (roundness > ROUNDNESS_EPSILON) roundness = std::min(roundness, std::max(size.x, size.y) * 0.5f);
|
||||
|
||||
if (!ctx->repeaters.empty()) {
|
||||
auto shape = rect->pooling();
|
||||
|
|
Loading…
Add table
Reference in a new issue