renderer/animation: rectified the segment value exception

A zero-range segment can be useful for a stopped motion.
There is no need to prohibit these values.
This commit is contained in:
Hermet Park 2024-07-25 18:45:44 +09:00 committed by Hermet Park
parent c8c565df92
commit b388bf06d5
2 changed files with 2 additions and 2 deletions

View file

@ -1957,7 +1957,7 @@ public:
* @retval Result::InsufficientCondition In case the animation is not loaded. * @retval Result::InsufficientCondition In case the animation is not loaded.
* @retval Result::NonSupport When it's not animatable. * @retval Result::NonSupport When it's not animatable.
* *
* @note Range from 0.0~1.0 * @note Animation allows a range from 0.0 to 1.0. @p end should not be higher than @p begin.
* @note If a marker has been specified, its range will be disregarded. * @note If a marker has been specified, its range will be disregarded.
* @see LottieAnimation::segment(const char* marker) * @see LottieAnimation::segment(const char* marker)
* @note Experimental API * @note Experimental API

View file

@ -95,7 +95,7 @@ float Animation::duration() const noexcept
Result Animation::segment(float begin, float end) noexcept Result Animation::segment(float begin, float end) noexcept
{ {
if (begin < 0.0 || end > 1.0 || begin >= end) return Result::InvalidArguments; if (begin < 0.0 || end > 1.0 || begin > end) return Result::InvalidArguments;
auto loader = pImpl->picture->pImpl->loader; auto loader = pImpl->picture->pImpl->loader;
if (!loader) return Result::InsufficientCondition; if (!loader) return Result::InsufficientCondition;