mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-28 21:48:13 +08:00
fix(core): vsync event used by frame is stopped by animation ending
This commit is contained in:
@@ -73,6 +73,7 @@ void AnimationFrameModule::RequestAnimationFrame(hippy::napi::CallbackInfo &info
|
||||
}
|
||||
has_event_listener_ = true;
|
||||
|
||||
root_node->SetVSyncEventNeedSource(VSyncEventNeedByFrame);
|
||||
listener_id_ = hippy::dom::FetchListenerId();
|
||||
auto weak_this = weak_from_this();
|
||||
std::weak_ptr<Scope> weak_scope = scope;
|
||||
@@ -112,6 +113,7 @@ void AnimationFrameModule::CancelAnimationFrame(hippy::napi::CallbackInfo &info,
|
||||
return;
|
||||
}
|
||||
|
||||
root_node->UnsetVSyncEventNeedSource(VSyncEventNeedByFrame);
|
||||
dom_manager->RemoveEventListener(root_node, root_node->GetId(), kVSyncKey, listener_id_);
|
||||
dom_manager->EndBatch(root_node);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user