lottie: adjusted the effect distance
Some checks are pending
Android / build_x86_64 (push) Waiting to run
Android / build_aarch64 (push) Waiting to run
iOS / build_x86_64 (push) Waiting to run
iOS / build_arm64 (push) Waiting to run
macOS / build (push) Waiting to run
macOS / compact_test (push) Waiting to run
macOS / unit_test (push) Waiting to run
Ubuntu / build (push) Waiting to run
Ubuntu / compact_test (push) Waiting to run
Ubuntu / unit_test (push) Waiting to run
Windows / build (push) Waiting to run
Windows / compact_test (push) Waiting to run
Windows / unit_test (push) Waiting to run

This commit is contained in:
Hermet Park 2025-07-07 16:28:20 +09:00 committed by Hermet Park
parent 3fe7432ac5
commit 4e645918c7
2 changed files with 7 additions and 3 deletions

View file

@ -1350,7 +1350,7 @@ void LottieBuilder::updateEffect(LottieLayer* layer, float frameNo)
auto effect = static_cast<LottieFxDropShadow*>(*p); auto effect = static_cast<LottieFxDropShadow*>(*p);
auto color = effect->color(frameNo); auto color = effect->color(frameNo);
//seems the opacity range in dropshadow is 0 ~ 256 //seems the opacity range in dropshadow is 0 ~ 256
layer->scene->push(SceneEffect::DropShadow, color.rgb[0], color.rgb[1], color.rgb[2], std::min(255, (int)effect->opacity(frameNo)), (double)effect->angle(frameNo), (double)effect->distance(frameNo), (double)(effect->blurness(frameNo) * BLUR_TO_SIGMA), QUALITY); layer->scene->push(SceneEffect::DropShadow, color.rgb[0], color.rgb[1], color.rgb[2], std::min(255, (int)effect->opacity(frameNo)), (double)effect->angle(frameNo), double(effect->distance(frameNo) * 0.5f), (double)(effect->blurness(frameNo) * BLUR_TO_SIGMA), QUALITY);
break; break;
} }
case LottieEffect::GaussianBlur: { case LottieEffect::GaussianBlur: {

View file

@ -1282,7 +1282,7 @@ bool LottieParser::parseEffect(LottieEffect* effect, void(LottieParser::*func)(L
if (KEY_AS("k")) (this->*func)(effect, idx++); if (KEY_AS("k")) (this->*func)(effect, idx++);
else skip(); else skip();
} }
} else skip(); } else (this->*func)(effect, idx++);
} }
else if (property && KEY_AS("nm")) property->nm = djb2Encode(getString()); else if (property && KEY_AS("nm")) property->nm = djb2Encode(getString());
else if (property && KEY_AS("mn")) property->mn = djb2Encode(getString()); else if (property && KEY_AS("mn")) property->mn = djb2Encode(getString());
@ -1297,6 +1297,7 @@ void LottieParser::parseCustom(LottieEffect* effect, int idx)
{ {
if ((uint32_t)idx >= static_cast<LottieFxCustom*>(effect)->props.count) { if ((uint32_t)idx >= static_cast<LottieFxCustom*>(effect)->props.count) {
TVGERR("LOTTIE", "Parsing error in Custom effect!"); TVGERR("LOTTIE", "Parsing error in Custom effect!");
skip();
return; return;
} }
@ -1315,7 +1316,10 @@ void LottieParser::parseCustom(LottieEffect* effect, int idx)
case LottieProperty::Type::Color: { case LottieProperty::Type::Color: {
parsePropertyInternal(*static_cast<LottieColor*>(prop)); break; parsePropertyInternal(*static_cast<LottieColor*>(prop)); break;
} }
default: TVGLOG("LOTTIE", "Missing Property Type? = %d", (int) prop->type); break; default: {
TVGLOG("LOTTIE", "Missing Property Type? = %d", (int) prop->type);
skip();
}
} }
} }