[NUI] Add Outline Offset and BlurRadius at struct Outline
authorANZ1217 <chihun.jeong@samsung.com>
Mon, 23 Sep 2024 07:47:45 +0000 (16:47 +0900)
committerbshsqa <32317749+bshsqa@users.noreply.github.com>
Wed, 25 Sep 2024 12:13:40 +0000 (21:13 +0900)
src/Tizen.NUI/src/public/BaseComponents/TextConstants.cs
src/Tizen.NUI/src/public/BaseComponents/TextMapHelper.cs

index 85b0b0d0c3d1c2d138b90322bc51d6c7b6d997c2..bcd69f4e9a99849c8a963e34d7e2eb14a4366540 100644 (file)
@@ -416,6 +416,20 @@ namespace Tizen.NUI.Text
         [EditorBrowsable(EditorBrowsableState.Never)]
         public float? Width { get; set; }
 
+        /// <summary>
+        /// The offset in pixels of the offset (if null, the default value is 0, 0). <br />
+        /// If not provided then the offset is not enabled. <br />
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Vector2? Offset { get; set; }
+
+        /// <summary>
+        /// The radius of blurring effect applied to the outline of the text. A higher value results in a more blurred outline. <br />
+        /// If not specified, the default value is 0 which means no blurring effect will be applied. <br />
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public float? BlurRadius { get; set; }
+
         /// <summary>
         /// Determines whether the specified object is equal to the current object.
         /// </summary>
@@ -430,7 +444,7 @@ namespace Tizen.NUI.Text
         /// <param name="other">The Outline to compare with the current Outline.</param>
         /// <returns>true if equal Outline, else false.</returns>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public bool Equals(Outline other) => Color == other.Color && Width == other.Width;
+        public bool Equals(Outline other) => Color == other.Color && Width == other.Width && Offset == other.Offset && BlurRadius == other.BlurRadius;
 
         /// <summary>
         /// The == operator.
index cf0454940f1c3b92fdc5a831aa5d1273aa1ae592..7683ab462d4930e973798047cbbafc41b4e30640 100644 (file)
@@ -384,6 +384,12 @@ namespace Tizen.NUI.BaseComponents
             if (outline.Width != null)
                 map.Add("width", (float)outline.Width);
 
+            if (outline.Offset != null)
+                map.Add("offset", outline.Offset);
+
+            if (outline.BlurRadius != null)
+                map.Add("blurRadius", (float)outline.BlurRadius);
+
             return map;
         }
 
@@ -401,6 +407,8 @@ namespace Tizen.NUI.BaseComponents
             {
                 outline.Color = GetColorFromMap(map, "color");
                 outline.Width = GetFloatFromMap(map, "width", 0.0f);
+                outline.Offset = GetVector2FromMap(map, "offset");
+                outline.BlurRadius = GetFloatFromMap(map, "blurRadius", 0.0f);
             }
 
             return outline;