提交 8e047568 编写于 作者: P pssea

Description: fix animator stop in other animator and animator callback last frame issue

IssueNo: #I3VSVG
Feature or Bugfix: Feature
Binary Source:No
Signed-off-by: Nlizhiqi <lizhiqi1@huawei.com>
上级 23bd067e
......@@ -61,6 +61,10 @@ void Animator::Run()
runTime_ = (UINT32_MAX - elapse > runTime_) ? (runTime_ + elapse) : period_;
if (!repeat_ && (runTime_ >= period_)) {
runTime_ = period_;
if (callback_ != nullptr) {
callback_->Callback(view_);
}
Stop();
return;
}
......
......@@ -56,7 +56,7 @@ void AnimatorManager::Remove(const Animator* animator)
ListNode<Animator*>* pos = list_.Begin();
while (pos != list_.End()) {
if (pos->data_ == animator) {
list_.Remove(pos);
pos->data_ = nullptr;
return;
}
pos = pos->next_;
......@@ -70,10 +70,15 @@ void AnimatorManager::AnimatorTask()
while (pos != list_.End()) {
animator = pos->data_;
pos = pos->next_;
if (animator == nullptr) {
// clean up animator list
pos = list_.Remove(pos);
continue;
}
if (animator->GetState() == Animator::START) {
animator->Run();
}
pos = pos->next_;
}
}
} // namespace OHOS
......@@ -14,6 +14,9 @@
*/
#include "engines/gfx/gfx_engine_manager.h"
#include <cstdlib>
#include "draw/draw_arc.h"
#include "draw/draw_curve.h"
#include "draw/draw_line.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册