Added Thickness.Add + unit tests

This commit is contained in:
Tig
2024-03-06 20:54:35 -07:00
parent 40768b5bf8
commit a8e9fcfca5
4 changed files with 114 additions and 22 deletions

View File

@@ -100,6 +100,17 @@ public class Thickness : IEquatable<Thickness>
return outside.Contains (x, y) && !inside.Contains (x, y);
}
/// <summary>
/// Adds the thickness widths of another <see cref="Thickness"/> to the current <see cref="Thickness"/>, returning a new <see cref="Thickness"/>.
/// </summary>
/// <param name="other"></param>
/// <returns></returns>
public Thickness Add (Thickness other)
{
return new Thickness (Left + other.Left, Top + other.Top, Right + other.Right, Bottom + other.Bottom);
}
/// <summary>Draws the <see cref="Thickness"/> rectangle with an optional diagnostics label.</summary>
/// <remarks>
/// If <see cref="ConsoleDriver.DiagnosticFlags"/> is set to