lottie: ++exception handling

dropshadow opacity range seems 0 ~ 256.
make it sure in 0 ~ 255.
This commit is contained in:
Hermet Park 2024-12-18 18:58:37 +09:00 committed by Mira Grudzinska
parent 64a5bd039d
commit 2eed9f9024

View file

@ -1343,7 +1343,8 @@ void LottieBuilder::updateEffect(LottieLayer* layer, float frameNo)
case LottieEffect::DropShadow: {
auto effect = static_cast<LottieFxDropShadow*>(*ef);
auto color = effect->color(frameNo);
layer->scene->push(SceneEffect::DropShadow, color.rgb[0], color.rgb[1], color.rgb[2], (int)effect->opacity(frameNo), effect->angle(frameNo), effect->distance(frameNo), effect->blurness(frameNo) * BLUR_TO_SIGMA, QUALITY);
//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)), effect->angle(frameNo), effect->distance(frameNo), effect->blurness(frameNo) * BLUR_TO_SIGMA, QUALITY);
break;
}
case LottieEffect::GaussianBlur: {