mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-15 12:34:30 +00:00
lottie: remove useless condition check.
lottie is always animatable.
This commit is contained in:
parent
2f21e76d85
commit
a5f69a9bbc
1 changed files with 5 additions and 9 deletions
|
@ -43,9 +43,7 @@ Result LottieAnimation::override(const char* slot) noexcept
|
||||||
{
|
{
|
||||||
if (!pImpl->picture->pImpl->loader) return Result::InsufficientCondition;
|
if (!pImpl->picture->pImpl->loader) return Result::InsufficientCondition;
|
||||||
|
|
||||||
if (static_cast<LottieLoader*>(pImpl->picture->pImpl->loader)->override(slot)) {
|
if (static_cast<LottieLoader*>(pImpl->picture->pImpl->loader)->override(slot)) return Result::Success;
|
||||||
return Result::Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Result::InvalidArguments;
|
return Result::InvalidArguments;
|
||||||
}
|
}
|
||||||
|
@ -55,7 +53,6 @@ Result LottieAnimation::segment(const char* marker) noexcept
|
||||||
{
|
{
|
||||||
auto loader = pImpl->picture->pImpl->loader;
|
auto loader = pImpl->picture->pImpl->loader;
|
||||||
if (!loader) return Result::InsufficientCondition;
|
if (!loader) return Result::InsufficientCondition;
|
||||||
if (!loader->animatable()) return Result::NonSupport;
|
|
||||||
|
|
||||||
if (!marker) {
|
if (!marker) {
|
||||||
static_cast<FrameModule*>(loader)->segment(0.0f, 1.0f);
|
static_cast<FrameModule*>(loader)->segment(0.0f, 1.0f);
|
||||||
|
@ -63,9 +60,8 @@ Result LottieAnimation::segment(const char* marker) noexcept
|
||||||
}
|
}
|
||||||
|
|
||||||
float begin, end;
|
float begin, end;
|
||||||
if (!static_cast<LottieLoader*>(loader)->segment(marker, begin, end)) {
|
if (!static_cast<LottieLoader*>(loader)->segment(marker, begin, end)) return Result::InvalidArguments;
|
||||||
return Result::InvalidArguments;
|
|
||||||
}
|
|
||||||
return static_cast<Animation*>(this)->segment(begin, end);
|
return static_cast<Animation*>(this)->segment(begin, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +69,7 @@ Result LottieAnimation::segment(const char* marker) noexcept
|
||||||
uint32_t LottieAnimation::markersCnt() noexcept
|
uint32_t LottieAnimation::markersCnt() noexcept
|
||||||
{
|
{
|
||||||
auto loader = pImpl->picture->pImpl->loader;
|
auto loader = pImpl->picture->pImpl->loader;
|
||||||
if (!loader || !loader->animatable()) return 0;
|
if (!loader) return 0;
|
||||||
return static_cast<LottieLoader*>(loader)->markersCnt();
|
return static_cast<LottieLoader*>(loader)->markersCnt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +77,7 @@ uint32_t LottieAnimation::markersCnt() noexcept
|
||||||
const char* LottieAnimation::marker(uint32_t idx) noexcept
|
const char* LottieAnimation::marker(uint32_t idx) noexcept
|
||||||
{
|
{
|
||||||
auto loader = pImpl->picture->pImpl->loader;
|
auto loader = pImpl->picture->pImpl->loader;
|
||||||
if (!loader || !loader->animatable()) return nullptr;
|
if (!loader) return nullptr;
|
||||||
return static_cast<LottieLoader*>(loader)->markers(idx);
|
return static_cast<LottieLoader*>(loader)->markers(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue