fix the difference of DefaultLayer and Layer 59/135959/2
authordongsug.song <dongsug.song@samsung.com>
Tue, 27 Jun 2017 13:03:01 +0000 (22:03 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Wed, 28 Jun 2017 11:53:58 +0000 (20:53 +0900)
- DefaultLayer has it's own size which is same as stage's
- Added Layer has zero size and top-left parent origin so this causes different
  behavior when user adds Views under the newly created Layer
- make same layouting behavior for both of DefaultLayer and Layer

Change-Id: If2bb25dd42116591a390546ddcf191939c7bd3aa
Signed-off-by: dongsug.song <dongsug.song@samsung.com>
Tizen.NUI/src/public/Layer.cs

index b9ab260..91775d1 100755 (executable)
@@ -78,9 +78,26 @@ namespace Tizen.NUI
         public Layer() : this(NDalicPINVOKE.Layer_New(), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
+            if(Window.Instance != null)
+            {
+                this.SetAnchorPoint(Tizen.NUI.PivotPoint.TopLeft);
+                this.SetResizePolicy(ResizePolicyType.FillToParent, DimensionType.AllDimensions);
+            }
+        }
+        internal void SetAnchorPoint(Vector3 anchorPoint)
+        {
+            NDalicPINVOKE.Actor_SetAnchorPoint(swigCPtr, Vector3.getCPtr(anchorPoint));
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+        internal void SetResizePolicy(ResizePolicyType policy, DimensionType dimension)
+        {
+            NDalicPINVOKE.Actor_SetResizePolicy(swigCPtr, (int)policy, (int)dimension);
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+
         /// <summary>
         /// Search through this layer's hierarchy for an view with the given unique ID.
         /// </summary>