lottie/api: specify clear result for override API

In case the given JSON is invalid, it's more closed to `Result::InvalidArguments`.
This commit is contained in:
Jinny You 2024-03-06 16:58:03 +09:00 committed by Hermet Park
parent cc2fa23359
commit 449cee7cf0
3 changed files with 5 additions and 3 deletions

View file

@ -2359,7 +2359,8 @@ TVG_API Tvg_Animation* tvg_lottie_animation_new();
*
* \return Tvg_Animation A new Tvg_LottieAnimation object.
* \retval TVG_RESULT_SUCCESS Succeed.
* \retval TVG_RESULT_INSUFFICIENT_CONDITION When the given @p slot is invalid
* \retval TVG_RESULT_INSUFFICIENT_CONDITION In case the animation is not loaded.
* \retval TVG_RESULT_INVALID_ARGUMENT When the given @p slot is invalid
* \retval TVG_RESULT_NOT_SUPPORTED The Lottie Animation is not supported.
*/
TVG_API Tvg_Result tvg_lottie_animation_override(Tvg_Animation* animation, const char* slot);

View file

@ -28,7 +28,8 @@ public:
* @param[in] slot The Lottie slot data in JSON format.
*
* @retval Result::Success When succeed.
* @retval Result::InsufficientCondition When the given parameter is invalid.
* @retval Result::InsufficientCondition In case the animation is not loaded.
* @retval Result::InvalidArguments When the given parameter is invalid.
*
* @note Experimental API
*/

View file

@ -46,7 +46,7 @@ Result LottieAnimation::override(const char* slot) noexcept
return Result::Success;
}
return Result::InsufficientCondition;
return Result::InvalidArguments;
}