@@ -5,12 +5,30 @@ namespace Synercoding.Primitives.Extensions;
5
5
/// </summary>
6
6
public static class RectangleExtensions
7
7
{
8
+ /// <summary>
9
+ /// Contract a given <see cref="Rectangle"/> (make smaller).
10
+ /// </summary>
11
+ /// <param name="rectangle">The <see cref="Rectangle"/> to contract.</param>
12
+ /// <param name="value">The amount to contract of each side of the <see cref="Size"/></param>
13
+ /// <returns>A new contracted <see cref="Rectangle"/>.</returns>
14
+ public static Rectangle Contract ( this Rectangle rectangle , Value value )
15
+ => rectangle . Contract ( new Spacing ( value ) ) ;
16
+
17
+ /// <summary>
18
+ /// Expand a given <see cref="Rectangle"/> (make bigger).
19
+ /// </summary>
20
+ /// <param name="rectangle">The <see cref="Rectangle"/> to expand.</param>
21
+ /// <param name="value">The amount to expand to each side of the <see cref="Size"/></param>
22
+ /// <returns>A new expanded <see cref="Rectangle"/>.</returns>
23
+ public static Rectangle Expand ( this Rectangle rectangle , Value value )
24
+ => rectangle . Expand ( new Spacing ( value ) ) ;
25
+
8
26
/// <summary>
9
27
/// Contract a given <see cref="Rectangle"/> (make smaller).
10
28
/// </summary>
11
29
/// <param name="rectangle">The <see cref="Rectangle"/> to contract.</param>
12
30
/// <param name="spacing">The amount of <see cref="Spacing"/> to contract on the sides.</param>
13
- /// <returns>A new contacted <see cref="Rectangle"/>.</returns>
31
+ /// <returns>A new contracted <see cref="Rectangle"/>.</returns>
14
32
public static Rectangle Contract ( this Rectangle rectangle , Spacing spacing )
15
33
=> new Rectangle (
16
34
llx : rectangle . LLX + spacing . Left ,
0 commit comments