File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
src/Synercoding.Primitives/Extensions Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ namespace Synercoding . Primitives . Extensions
2
+ {
3
+ /// <summary>
4
+ /// Extensions methods for <see cref="Point"/>
5
+ /// </summary>
6
+ public static class PointExtensions
7
+ {
8
+ /// <summary>
9
+ /// Get the raw values representing this Point in a provided unit
10
+ /// </summary>
11
+ /// <param name="point">The point to get in raw format</param>
12
+ /// <param name="unit">The unit to get the result in.</param>
13
+ /// <returns>A tuple representing the raw values.</returns>
14
+ public static ( double X , double Y ) AsRaw ( this Point point , Unit unit )
15
+ => ( point . X . AsRaw ( unit ) , point . Y . AsRaw ( unit ) ) ;
16
+ }
17
+ }
Original file line number Diff line number Diff line change @@ -42,5 +42,14 @@ public static Rectangle AsRectangle(this Size size)
42
42
/// <returns>A new size with width and height switched</returns>
43
43
public static Size Rotate ( this Size size )
44
44
=> new Size ( size . Height , size . Width ) ;
45
+
46
+ /// <summary>
47
+ /// Get the raw values representing this Size in a provided unit
48
+ /// </summary>
49
+ /// <param name="size">The size to get in raw format</param>
50
+ /// <param name="unit">The unit to get the result in.</param>
51
+ /// <returns>A tuple representing the raw values.</returns>
52
+ public static ( double Width , double Height ) AsRaw ( this Size size , Unit unit )
53
+ => ( size . Width . AsRaw ( unit ) , size . Height . AsRaw ( unit ) ) ;
45
54
}
46
55
}
You can’t perform that action at this time.
0 commit comments