[NUI][SVACE] fix svace defect (add null check, replace TopCentor as Vector3 which...
authordongsug.song <dongsug.song@samsung.com>
Wed, 27 Apr 2022 05:04:44 +0000 (14:04 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 27 Apr 2022 05:57:47 +0000 (14:57 +0900)
src/Tizen.NUI/src/public/Window/BorderWindow.cs
src/Tizen.NUI/src/public/Window/DefaultBorder.cs

index 33505b0..dd804d8 100755 (executable)
@@ -369,8 +369,9 @@ namespace Tizen.NUI
             {
                 borderWindowBottomLayer = new Layer();
                 borderWindowBottomLayer.Name = "BorderWindowBottomLayer";
-                Interop.ActorInternal.SetParentOrigin(borderWindowBottomLayer.SwigCPtr, Tizen.NUI.ParentOrigin.TopCenter.SwigCPtr);
-                Interop.Actor.SetAnchorPoint(borderWindowBottomLayer.SwigCPtr, Tizen.NUI.PivotPoint.TopCenter.SwigCPtr);
+                using Vector3 topCentor = new Vector3(0.5f, 0.0f, 0.5f);
+                Interop.ActorInternal.SetParentOrigin(borderWindowBottomLayer.SwigCPtr, topCentor.SwigCPtr);
+                Interop.Actor.SetAnchorPoint(borderWindowBottomLayer.SwigCPtr, topCentor.SwigCPtr);
                 Interop.Actor.Add(rootLayer.SwigCPtr, borderWindowBottomLayer.SwigCPtr);
                 Interop.ActorInternal.SetSize(borderWindowBottomLayer.SwigCPtr, WindowSize.Width+borderInterface.BorderLineThickness * 2, WindowSize.Height + borderInterface.BorderLineThickness);
                 borderWindowBottomLayer.SetWindow(this);
@@ -387,8 +388,9 @@ namespace Tizen.NUI
             {
                 borderWindowRootLayer = new Layer();
                 borderWindowRootLayer.Name = "RootLayer";
-                Interop.ActorInternal.SetParentOrigin(borderWindowRootLayer.SwigCPtr, Tizen.NUI.ParentOrigin.TopCenter.SwigCPtr);
-                Interop.Actor.SetAnchorPoint(borderWindowRootLayer.SwigCPtr, Tizen.NUI.PivotPoint.TopCenter.SwigCPtr);
+                using Vector3 topCentor = new Vector3(0.5f, 0.0f, 0.5f);
+                Interop.ActorInternal.SetParentOrigin(borderWindowRootLayer.SwigCPtr, topCentor.SwigCPtr);
+                Interop.Actor.SetAnchorPoint(borderWindowRootLayer.SwigCPtr, topCentor.SwigCPtr);
                 Interop.Actor.Add(rootLayer.SwigCPtr, borderWindowRootLayer.SwigCPtr);
                 Interop.ActorInternal.SetSize(borderWindowRootLayer.SwigCPtr, WindowSize.Width, WindowSize.Height-borderInterface.BorderHeight - borderInterface.BorderLineThickness);
                 Interop.ActorInternal.SetPosition(borderWindowRootLayer.SwigCPtr, 0, borderInterface.BorderLineThickness);
index b3004ed..fa26f81 100755 (executable)
@@ -268,7 +268,7 @@ namespace Tizen.NUI
             }
             PanGesture panGesture = e.PanGesture;
 
-            if (panGesture.State == Gesture.StateType.Started)
+            if (panGesture.State == Gesture.StateType.Started && panGesture.Position != null)
             {
                 direction = BorderWindow.GetDirection(panGesture.Position.X, panGesture.Position.Y);
                 if (direction == Window.BorderDirection.Move)