!48114 修复超过50行的问题

Merge pull request !48114 from 贺晨韬/hct_fix_mouse_over50
This commit is contained in:
openharmony_ci 2024-11-11 12:43:34 +00:00 committed by Gitee
commit f93e2acbe5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 10 additions and 12 deletions

View File

@ -3460,9 +3460,8 @@ void PipelineContext::CancelDragIfRightBtnPressed(const MouseEvent& event)
manager->SetIsDragCancel(false);
}
void PipelineContext::OnMouseEvent(const MouseEvent& event, const RefPtr<FrameNode>& node)
void PipelineContext::UpdateLastMoveEvent(const MouseEvent& event)
{
CHECK_RUN_ON(UI);
if (!lastMouseEvent_) {
lastMouseEvent_ = std::make_unique<MouseEvent>();
}
@ -3473,6 +3472,12 @@ void PipelineContext::OnMouseEvent(const MouseEvent& event, const RefPtr<FrameNo
lastMouseEvent_->sourceType = event.sourceType;
lastMouseEvent_->time = event.time;
lastMouseEvent_->touchEventId = event.touchEventId;
}
void PipelineContext::OnMouseEvent(const MouseEvent& event, const RefPtr<FrameNode>& node)
{
CHECK_RUN_ON(UI);
UpdateLastMoveEvent(event);
if (event.action == MouseAction::PRESS || event.action == MouseAction::RELEASE) {
#ifdef IS_RELEASE_VERSION
@ -3979,16 +3984,7 @@ void PipelineContext::OnMouseMoveEventForAxisEvent(const MouseEvent& event, cons
return;
}
CHECK_RUN_ON(UI);
if (!lastMouseEvent_) {
lastMouseEvent_ = std::make_unique<MouseEvent>();
}
lastMouseEvent_->x = event.x;
lastMouseEvent_->y = event.y;
lastMouseEvent_->button = event.button;
lastMouseEvent_->action = event.action;
lastMouseEvent_->sourceType = event.sourceType;
lastMouseEvent_->time = event.time;
lastMouseEvent_->touchEventId = event.touchEventId;
UpdateLastMoveEvent(event);
auto manager = GetDragDropManager();
if (manager) {
manager->SetIsDragCancel(false);

View File

@ -1065,6 +1065,8 @@ private:
void CancelDragIfRightBtnPressed(const MouseEvent& event);
void UpdateLastMoveEvent(const MouseEvent& event);
void CompensateTouchMoveEvent(const TouchEvent& event);
bool CompensateTouchMoveEventFromUnhandledEvents(const TouchEvent& event);