mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 23:21:05 +00:00
!38500 [bugfix]:[修复popup错误移除targetNode的onAreaChange事件问题]
Merge pull request !38500 from miaoyu/onareachangenew
This commit is contained in:
commit
1bb9f201f0
@ -112,6 +112,9 @@ void BubblePattern::OnAttachToFrameNode()
|
||||
|
||||
auto targetNode = FrameNode::GetFrameNode(targetTag_, targetNodeId_);
|
||||
CHECK_NULL_VOID(targetNode);
|
||||
auto pipelineContext = host->GetContextRefPtr();
|
||||
CHECK_NULL_VOID(pipelineContext);
|
||||
hasOnAreaChange_ = pipelineContext->HasOnAreaChangeNode(targetNode->GetId());
|
||||
auto eventHub = targetNode->GetEventHub<EventHub>();
|
||||
CHECK_NULL_VOID(eventHub);
|
||||
OnAreaChangedFunc onAreaChangedFunc = [popupNodeWk = WeakPtr<FrameNode>(host)](const RectF& oldRect,
|
||||
@ -148,7 +151,9 @@ void BubblePattern::OnDetachFromFrameNode(FrameNode* frameNode)
|
||||
pipeline->RemoveWindowStateChangedCallback(frameNode->GetId());
|
||||
auto targetNode = FrameNode::GetFrameNode(targetTag_, targetNodeId_);
|
||||
CHECK_NULL_VOID(targetNode);
|
||||
pipeline->RemoveOnAreaChangeNode(targetNode->GetId());
|
||||
if (!hasOnAreaChange_) {
|
||||
pipeline->RemoveOnAreaChangeNode(targetNode->GetId());
|
||||
}
|
||||
}
|
||||
|
||||
void BubblePattern::InitTouchEvent()
|
||||
|
@ -291,6 +291,7 @@ private:
|
||||
ACE_DISALLOW_COPY_AND_MOVE(BubblePattern);
|
||||
|
||||
bool hasTransition_ = false;
|
||||
bool hasOnAreaChange_ = false;
|
||||
};
|
||||
} // namespace OHOS::Ace::NG
|
||||
|
||||
|
@ -2935,6 +2935,11 @@ void PipelineContext::RemoveOnAreaChangeNode(int32_t nodeId)
|
||||
isOnAreaChangeNodesCacheVaild_ = false;
|
||||
}
|
||||
|
||||
bool PipelineContext::HasOnAreaChangeNode(int32_t nodeId)
|
||||
{
|
||||
return onAreaChangeNodeIds_.find(nodeId) != onAreaChangeNodeIds_.end();
|
||||
}
|
||||
|
||||
void PipelineContext::HandleOnAreaChangeEvent(uint64_t nanoTimestamp)
|
||||
{
|
||||
ACE_FUNCTION_TRACE();
|
||||
|
@ -193,6 +193,8 @@ public:
|
||||
return {};
|
||||
}
|
||||
|
||||
bool HasOnAreaChangeNode(int32_t nodeId);
|
||||
|
||||
void AddOnAreaChangeNode(int32_t nodeId);
|
||||
|
||||
void RemoveOnAreaChangeNode(int32_t nodeId);
|
||||
|
@ -709,6 +709,11 @@ void PipelineContext::FlushNodeChangeFlag() {}
|
||||
|
||||
void PipelineContext::CleanNodeChangeFlag() {}
|
||||
|
||||
bool PipelineContext::HasOnAreaChangeNode(int32_t nodeId)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace OHOS::Ace::NG
|
||||
// pipeline_context ============================================================
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user