mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-10 06:34:01 +00:00
lottie: ++exception handling
dropshadow opacity range seems 0 ~ 256. make it sure in 0 ~ 255.
This commit is contained in:
parent
64a5bd039d
commit
2eed9f9024
1 changed files with 2 additions and 1 deletions
|
@ -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: {
|
||||
|
|
Loading…
Add table
Reference in a new issue