[NUI] remove previous shadowView before adding new shadowView
authorTaehyub Kim <taehyub.kim@samsung.com>
Mon, 9 May 2022 11:54:57 +0000 (20:54 +0900)
committerSangHyeon Jade Lee <dltkdgus1764@gmail.com>
Tue, 10 May 2022 06:09:58 +0000 (15:09 +0900)
src/Tizen.NUI/src/public/DragAndDrop/DragAndDrop.cs

index e824e4e..59b839c 100755 (executable)
@@ -37,6 +37,7 @@ namespace Tizen.NUI
         private delegate void InternalDragAndDropEventHandler(global::System.IntPtr dragEvent);
         private InternalSourceEventHandler sourceEventCb;
         private Dictionary<View, InternalDragAndDropEventHandler> targetEventDictionary = new Dictionary<View, InternalDragAndDropEventHandler>();
+        private View mShadowView;
         private Window mDragWindow;
         private const int shadowWidth = 150;
         private const int shadowHeight = 150;
@@ -84,7 +85,13 @@ namespace Tizen.NUI
             shadowView.SetSize(shadowWidth, shadowHeight);
             shadowView.SetOpacity(0.9f);
 
-            mDragWindow.Add(shadowView);
+            if (mShadowView)
+            {
+                mDragWindow.Remove(mShadowView);
+            }
+
+            mShadowView = shadowView;
+            mDragWindow.Add(mShadowView);
             mDragWindow.Show();
 
             sourceEventCb = (sourceEventType) =>