Skip to content

Commit

Permalink
[NUI] Fix build warning for UIExtents
Browse files Browse the repository at this point in the history
Signed-off-by: Jiyun Yang <[email protected]>
  • Loading branch information
rabbitfor committed Feb 10, 2025
1 parent f5e55c1 commit 9421eaf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Tizen.NUI/src/devel/Lite/UIExtents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,23 +160,26 @@ public void Deconstruct(out float start, out float end, out float top, float bo
/// <summary>
/// Adds the specified <see cref="float"/> to each component of the <see cref="UIExtents"/>.
/// </summary>
/// <param name="addend">The value to add.</param>
/// <param name="left">The left operand.</param>
/// <param name="addend">The float value to add.</param>
/// <returns>A new <see cref="UIExtents"/> with the added values.</returns>
public static UIExtents operator +(UIExtents left, float addend) => new UIExtents(left.Start + addend, left.End + addend, left.Top + addend, left.Bottom + addend);

/// <summary>
/// Adds the specified <see cref="UIExtents"/> to the current <see cref="UIExtents"/>.
/// </summary>
/// <param name="right">The <see cref="UIExtents"/> to add.</param>
/// <param name="left">The left operand.</param>
/// <param name="right">The right operand.</param>
/// <returns>A new <see cref="UIExtents"/> with the added values.</returns>
public static UIExtents operator +(UIExtents left, UIExtents right) => new UIExtents(left.Start + right.Start, left.End + right.End, left.Top + right.Top, left.Bottom + right.Bottom);

/// <summary>
/// Subtracts the specified <see cref="float"/> from each component of the <see cref="UIExtents"/>.
/// </summary>
/// <param name="left">The left operand.</param>
/// <param name="subtrahend">The value to subtract.</param>
/// <returns>A new <see cref="UIExtents"/> with the subtracted values.</returns>
public static UIExtents operator -(UIExtents left, float addend) => left + (-addend);
public static UIExtents operator -(UIExtents left, float subtrahend) => left + (-subtrahend);

public static implicit operator Extents(UIExtents uiExtents) => new Extents((ushort)uiExtents.Start, (ushort)uiExtents.End, (ushort)uiExtents.Top, (ushort)uiExtents.Bottom);
}
Expand Down

0 comments on commit 9421eaf

Please sign in to comment.