Skip to content

Commit ec3efca

Browse files
committed
CoreGraphics: add a definition of CGRectEdge
Add the `Rect.Edge` enumeration which is used by the last missing function: `Rect.divided(atDistance:from:)`.
1 parent c4c6355 commit ec3efca

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Sources/SwiftWin32/CG/Rect.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,28 @@ private func __equals(_ lhs: Rect, _ rhs: Rect) -> Bool {
99
return lhs.origin == rhs.origin && lhs.size == rhs.size
1010
}
1111

12+
extension Rect {
13+
/// Coordinates that establish the edges of a rectangle.
14+
@frozen
15+
public enum Edge: UInt32 {
16+
/// The minimum value for the x-coordinate of the rectangle. In the default
17+
/// coordinate space, this is the left edge of the rectangle.
18+
case minXEdge
19+
20+
/// The minimum value for the y-coordinate of the rectangle. In the default
21+
/// coordinate space, this is the top edge of the rectangle.
22+
case minYEdge
23+
24+
/// The maximum value for the x-coordinate of the rectangle. In the default
25+
/// coordinate space, this is the right edge of the rectangle.
26+
case maxXEdge
27+
28+
/// The maximum value for the y-coordinate of the rectangle. In the default
29+
/// coordinate space, this is the bottom edge of the rectangle.
30+
case maxYEdge
31+
}
32+
}
33+
1234
/// A structure that contains the location and dimensions of a rectangle.
1335
public struct Rect {
1436
// MARK - Creating Rectangle Values

0 commit comments

Comments
 (0)