!39999 修复拖拽拖起动效阶段,落位闪一下的问题

Merge pull request !39999 from 贺晨韬/hct_drag_cancel_noId
This commit is contained in:
openharmony_ci 2024-08-09 02:36:01 +00:00 committed by Gitee
commit 94dbe7260d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -755,7 +755,6 @@ void DragDropManager::OnDragEnd(const PointerEvent& pointerEvent, const std::str
return;
}
}
HideDragPreviewOverlay();
if (isDragCancel_) {
TAG_LOGI(AceLogTag::ACE_DRAG, "DragDropManager is dragCancel, finish drag. WindowId is %{public}d, "
"pointerEventId is %{public}d.",
@ -924,11 +923,15 @@ void DragDropManager::OnDragDrop(RefPtr<OHOS::Ace::DragEvent>& event, const RefP
CHECK_NULL_VOID(container);
auto windowId = container->GetWindowId();
pipeline->AddAfterRenderTask([dragResult, useCustomAnimation, windowId, dragBehavior,
pointerEventId = pointerEvent.pointerEventId]() {
pointerEventId = pointerEvent.pointerEventId, weak = WeakClaim(this)]() {
TAG_LOGI(AceLogTag::ACE_DRAG,
"Stop drag, start do drop animation. UseCustomAnimation is %{public}d,"
"WindowId is %{public}d, pointerEventId is %{public}d.",
useCustomAnimation, windowId, pointerEventId);
auto manager = weak.Upgrade();
if (manager) {
manager->HideDragPreviewOverlay();
}
InteractionInterface::GetInstance()->SetDragWindowVisible(!useCustomAnimation);
DragDropRet dragDropRet { dragResult, useCustomAnimation, windowId, dragBehavior };
InteractionInterface::GetInstance()->StopDrag(dragDropRet);
@ -1987,6 +1990,7 @@ void DragDropManager::GetGatherPixelMap(DragDataCore& dragData, float scale, flo
void DragDropManager::ResetDragDrop(int32_t windowId, const Point& point)
{
DragDropRet dragDropRet { DragRet::DRAG_FAIL, isMouseDragged_, windowId, DragBehavior::UNKNOWN };
HideDragPreviewOverlay();
ResetDragDropStatus(point, dragDropRet, windowId);
dragCursorStyleCore_ = DragCursorStyleCore::DEFAULT;
}