!47000 grid使用OnItemDrag拖拽切后台跟手图卡住

Merge pull request !47000 from Hone/h_1028_1
This commit is contained in:
openharmony_ci 2024-11-02 13:19:11 +00:00 committed by Gitee
commit 9c36332d1f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 15 additions and 8 deletions

View File

@ -814,6 +814,18 @@ void DragDropManager::DoDragReset()
isDragNodeNeedClean_ = false;
}
void DragDropManager::ResetDraggingStatus(const TouchEvent& touchPoint)
{
if (IsDraggingPressed(touchPoint.id)) {
SetDraggingPressedState(false);
}
if (!IsItemDragging() && IsDragging() && IsSameDraggingPointer(touchPoint.id)) {
OnDragEnd(
PointerEvent(touchPoint.touchEventId, touchPoint.x, touchPoint.y, touchPoint.screenX, touchPoint.screenY),
"");
}
}
void DragDropManager::HandleOnDragEnd(const PointerEvent& pointerEvent, const std::string& extraInfo,
const RefPtr<FrameNode>& dragFrameNode)
{

View File

@ -472,6 +472,8 @@ public:
currentPullId_ = -1;
}
void ResetDraggingStatus(const TouchEvent& touchPoint);
private:
double CalcDragPreviewDistanceWithPoint(
const OHOS::Ace::Dimension& preserverHeight, int32_t x, int32_t y, const DragPreviewInfo& info);

View File

@ -2944,14 +2944,7 @@ void PipelineContext::ResetDraggingStatus(const TouchEvent& touchPoint, const Re
{
auto manager = GetDragDropManager();
CHECK_NULL_VOID(manager);
if (manager->IsDraggingPressed(touchPoint.id)) {
manager->SetDraggingPressedState(false);
}
if (manager->IsDragging() && manager->IsSameDraggingPointer(touchPoint.id)) {
manager->OnDragEnd(
PointerEvent(touchPoint.touchEventId, touchPoint.x, touchPoint.y, touchPoint.screenX, touchPoint.screenY),
"");
}
manager->ResetDraggingStatus(touchPoint);
}
void PipelineContext::OnSurfaceDensityChanged(double density)