mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-08 15:45:22 +00:00
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
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:
parent
3fe7432ac5
commit
4e645918c7
2 changed files with 7 additions and 3 deletions
|
@ -1350,7 +1350,7 @@ void LottieBuilder::updateEffect(LottieLayer* layer, float frameNo)
|
|||
auto effect = static_cast<LottieFxDropShadow*>(*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: {
|
||||
|
|
|
@ -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<LottieFxCustom*>(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<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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue