mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
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:
parent
2478a5f65a
commit
656fb6f498
2 changed files with 2 additions and 2 deletions
|
@ -1963,7 +1963,7 @@ public:
|
|||
* @retval Result::InsufficientCondition In case the animation is not loaded.
|
||||
* @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.
|
||||
* @see LottieAnimation::segment(const char* marker)
|
||||
* @note Experimental API
|
||||
|
|
|
@ -95,7 +95,7 @@ float Animation::duration() const 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;
|
||||
if (!loader) return Result::InsufficientCondition;
|
||||
|
|
Loading…
Add table
Reference in a new issue