lottie: prioritization of roundness in rectangles

Added prioritization of rectangle roundness over
rounded corners, in line with AE results.
This commit is contained in:
Mira Grudzinska 2024-08-12 23:32:08 +02:00 committed by Hermet Park
parent 88b4f75e4f
commit 7c13da461a

View file

@ -470,9 +470,11 @@ void LottieBuilder::updateRect(LottieGroup* parent, LottieObject** child, float
auto position = rect->position(frameNo, exps); auto position = rect->position(frameNo, exps);
auto size = rect->size(frameNo, exps); auto size = rect->size(frameNo, exps);
auto roundness = rect->radius(frameNo, exps); auto roundness = rect->radius(frameNo, exps);
if (ctx->roundness > roundness) roundness = ctx->roundness; if (roundness == 0.0f) {
if (ctx->roundness > ROUNDNESS_EPSILON) roundness = std::min(ctx->roundness, std::max(size.x, size.y) * 0.5f);
if (roundness > ROUNDNESS_EPSILON) roundness = std::min(roundness, std::max(size.x, size.y) * 0.5f); } else {
roundness = std::min({roundness, size.x * 0.5f, size.y * 0.5f});
}
if (!ctx->repeaters.empty()) { if (!ctx->repeaters.empty()) {
auto shape = rect->pooling(); auto shape = rect->pooling();