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:
Mira Grudzinska 2024-08-09 18:47:37 +02:00 committed by Hermet Park
parent 5ae556cf13
commit e50bf002de

View file

@ -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();