@@ -18,6 +18,19 @@ public static Rectangle Contract(this Rectangle rectangle, Spacing spacing)
18
18
urx : rectangle . URX - spacing . Right ,
19
19
ury : rectangle . URY - spacing . Top ) ;
20
20
21
+ /// <summary>
22
+ /// Contract a given <see cref="Rectangle"/> (make smaller).
23
+ /// </summary>
24
+ /// <param name="rectangle">The <see cref="Rectangle"/> to contract.</param>
25
+ /// <param name="value">The amount of <see cref="Value"/> to contract on all sides.</param>
26
+ /// <returns>A new contacted <see cref="Rectangle"/>.</returns>
27
+ public static Rectangle Contract ( this Rectangle rectangle , Value value )
28
+ => new Rectangle (
29
+ llx : rectangle . LLX + value ,
30
+ lly : rectangle . LLY + value ,
31
+ urx : rectangle . URX - value ,
32
+ ury : rectangle . URY - value ) ;
33
+
21
34
/// <summary>
22
35
/// Expand a given <see cref="Rectangle"/> (make bigger).
23
36
/// </summary>
@@ -31,6 +44,19 @@ public static Rectangle Expand(this Rectangle rectangle, Spacing spacing)
31
44
urx : rectangle . URX + spacing . Right ,
32
45
ury : rectangle . URY + spacing . Top ) ;
33
46
47
+ /// <summary>
48
+ /// Expand a given <see cref="Rectangle"/> (make bigger).
49
+ /// </summary>
50
+ /// <param name="rectangle">The rectangle to expand</param>
51
+ /// <param name="value">The amount of <see cref="Value"/> to expand on all sides.</param>
52
+ /// <returns>A new expanded <see cref="Rectangle"/>.</returns>
53
+ public static Rectangle Expand ( this Rectangle rectangle , Value value )
54
+ => new Rectangle (
55
+ llx : rectangle . LLX - value ,
56
+ lly : rectangle . LLY - value ,
57
+ urx : rectangle . URX + value ,
58
+ ury : rectangle . URY + value ) ;
59
+
34
60
/// <summary>
35
61
/// Get the raw values representing this <see cref="Rectangle"/> in a provided unit.
36
62
/// </summary>
0 commit comments