diff --git a/inc/thorvg.h b/inc/thorvg.h index b2027467..3e5c18df 100644 --- a/inc/thorvg.h +++ b/inc/thorvg.h @@ -1701,8 +1701,8 @@ public: * @param[in] no The index of the animation frame to be displayed. The index should be less than the totalFrame(). * * @retval Result::Success Successfully set the frame. - * @retval Result::InsufficientCondition No animatable data loaded from the Picture. - * @retval Result::NonSupport The Picture data does not support animations. + * @retval Result::InsufficientCondition if the given @p no is the same as the current frame value. + * @retval Result::NonSupport The current Picture data does not support animations. * * @see totalFrame() * diff --git a/src/bindings/wasm/tvgWasm.cpp b/src/bindings/wasm/tvgWasm.cpp index a5fe71be..a57a03de 100644 --- a/src/bindings/wasm/tvgWasm.cpp +++ b/src/bindings/wasm/tvgWasm.cpp @@ -152,13 +152,9 @@ public: bool frame(float no) { if (!canvas || !animation) return false; - if (animation->frame(no) != Result::Success) { - errorMsg = "frame() fail"; - return false; + if (animation->frame(no) == Result::Success) { + updated = true; } - - updated = true; - return true; }