wasm: fix a regression bug.

The Animation::frame() method has been modified.
It will now return InsufficientCondition,
if the frame value is the same as the previous one.

In addition to this change, we have also updated its usage accordingly.
This commit is contained in:
Hermet Park 2023-10-31 10:46:10 +09:00 committed by Hermet Park
parent d6fffd13c2
commit 2d2928652b
2 changed files with 4 additions and 8 deletions

View file

@ -1648,8 +1648,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()
*

View file

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