lottie: remove useless condition check.

lottie is always animatable.
This commit is contained in:
Hermet Park 2024-08-01 12:48:17 +09:00
parent 2f21e76d85
commit a5f69a9bbc

View file

@ -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);
} }