Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NUI] Add Outline Offset and BlurRadius at struct Outline #6342

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading