Skip to content

Commit

Permalink
[NUI] Add Outline Offset and BlurRadius at struct Outline
Browse files Browse the repository at this point in the history
  • Loading branch information
ANZ1217 authored and wonrst committed Sep 24, 2024
1 parent fefbaad commit 0b18460
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Tizen.NUI/src/public/BaseComponents/TextConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,20 @@ public struct Outline : IEquatable<Outline>
[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>
Expand All @@ -430,7 +444,7 @@ public struct Outline : IEquatable<Outline>
/// <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.
Expand Down
8 changes: 8 additions & 0 deletions src/Tizen.NUI/src/public/BaseComponents/TextMapHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,12 @@ public static PropertyMap GetOutlineMap(Outline outline)
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;
}

Expand All @@ -401,6 +407,8 @@ public static Outline GetOutlineStruct(PropertyMap map)
{
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;
Expand Down

0 comments on commit 0b18460

Please sign in to comment.