Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Sources/OpenCoreGraphics/CGGeometry+Hashable.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// CGGeometry+Hashable.swift
// OpenCoreGraphics

#if !canImport(Darwin)
// Foundation does not provide Hashable conformance for CG types yet.
// See https://github.com/swiftlang/swift-corelibs-foundation/issues/5275
extension CGPoint: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(x)
hasher.combine(y)
}
}

extension CGSize: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(width)
hasher.combine(height)
}
}

extension CGRect: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(origin)
hasher.combine(size)
}
}
#endif
Loading