fixed bug(N_SE-47706,N_SE-47877)
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrl_EditCopyPasteManager.cpp
index fb67875..2a32729 100644 (file)
@@ -988,9 +988,23 @@ _EditCopyPasteHandler::OnDraw(void)
 bool
 _EditCopyPasteHandler::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
 {
-       __pCopyPasteManager->ReleaseCopyPastePopup();
+       _ContextMenu* pCopyPastePopup = __pCopyPasteManager->GetCopyPastePopup();
+       if (pCopyPastePopup)
+       {
+               pCopyPastePopup->SetVisibleState(false);
+               pCopyPastePopup->Close();
+       }
+
 #if EDIT_COPY_PASTE_MAGNIFIER
-       CreateCopyPasteMagnifier();
+       if (!__pCopyPasteMagnifier)
+       {
+               CreateCopyPasteMagnifier();
+       }
+       else
+       {
+               __pCopyPasteMagnifier->SetVisibleState(true);
+               __pCopyPasteMagnifier->Open();
+       }
 #endif
        __touchPressedPoint = touchinfo.GetCurrentPosition();
        __absoluteTouchPressedPoint = FloatPoint(GetBoundsF().x + __touchPressedPoint.x, GetBoundsF().y + __touchPressedPoint.y);
@@ -1267,8 +1281,21 @@ _EditCopyPasteHandler::OnTouchReleased(const _Control& source, const _TouchInfo&
        CheckReverseStatus();
        __isTouchPressed = false;
        __absoluteTouchPressedPoint = FloatPoint(0.0f, 0.0f);
-       DestroyCopyPasteMagnifier();
-       __pCopyPasteManager->CreateCopyPastePopup();
+       if (__pCopyPasteMagnifier)
+       {
+               __pCopyPasteMagnifier->SetVisibleState(false);
+               __pCopyPasteMagnifier->Close();
+       }
+       _ContextMenu* pCopyPastePopup = __pCopyPasteManager->GetCopyPastePopup();
+       if (pCopyPastePopup && !__isTouchMoving)
+       {
+               pCopyPastePopup->SetVisibleState(true);
+               pCopyPastePopup->Open();
+       }
+       else
+       {
+               __pCopyPasteManager->CreateCopyPastePopup();
+       }
        __pCopyPasteManager->Show();
        __pCopyPasteManager->SendTextBlockEvent();
        Invalidate();
@@ -1971,7 +1998,7 @@ _EditCopyPasteManager::CreateCopyPastePopup(void)
                        editShowAreaAbsRect.y = panelAbsoulteBounds.y;
                        editShowAreaAbsRect.height -= (panelAbsoulteBounds.y - editShowAreaAbsRect.y);
                }
-               __editVisibleArea = editShowAreaAbsRect;
+               __editVisibleArea = CoordinateSystem::AlignToDevice(editShowAreaAbsRect);
        }
        FloatPoint copyPastePoint(0.0f, 0.0f);
        __contextMenuAlign = CONTEXT_MENU_CORE_ALIGN_UP;