From 4e645918c75787979ea7ad50355cac697e1cae18 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Mon, 7 Jul 2025 16:28:20 +0900 Subject: [PATCH] lottie: adjusted the effect distance --- src/loaders/lottie/tvgLottieBuilder.cpp | 2 +- src/loaders/lottie/tvgLottieParser.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/loaders/lottie/tvgLottieBuilder.cpp b/src/loaders/lottie/tvgLottieBuilder.cpp index d0c44088..838f429b 100644 --- a/src/loaders/lottie/tvgLottieBuilder.cpp +++ b/src/loaders/lottie/tvgLottieBuilder.cpp @@ -1350,7 +1350,7 @@ void LottieBuilder::updateEffect(LottieLayer* layer, float frameNo) auto effect = static_cast(*p); auto color = effect->color(frameNo); //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; } case LottieEffect::GaussianBlur: { diff --git a/src/loaders/lottie/tvgLottieParser.cpp b/src/loaders/lottie/tvgLottieParser.cpp index 7b08ed00..486a1e04 100644 --- a/src/loaders/lottie/tvgLottieParser.cpp +++ b/src/loaders/lottie/tvgLottieParser.cpp @@ -1282,7 +1282,7 @@ bool LottieParser::parseEffect(LottieEffect* effect, void(LottieParser::*func)(L if (KEY_AS("k")) (this->*func)(effect, idx++); else skip(); } - } else skip(); + } else (this->*func)(effect, idx++); } else if (property && KEY_AS("nm")) property->nm = 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(effect)->props.count) { TVGERR("LOTTIE", "Parsing error in Custom effect!"); + skip(); return; } @@ -1315,7 +1316,10 @@ void LottieParser::parseCustom(LottieEffect* effect, int idx) case LottieProperty::Type::Color: { parsePropertyInternal(*static_cast(prop)); break; } - default: TVGLOG("LOTTIE", "Missing Property Type? = %d", (int) prop->type); break; + default: { + TVGLOG("LOTTIE", "Missing Property Type? = %d", (int) prop->type); + skip(); + } } }