|
|
@@ -27,8 +27,7 @@
|
|
|
import AppKit
|
|
|
#endif
|
|
|
|
|
|
-
|
|
|
-public struct ConstraintPriority : ExpressibleByFloatLiteral, Equatable {
|
|
|
+public struct ConstraintPriority : ExpressibleByFloatLiteral, Equatable, Strideable {
|
|
|
public typealias FloatLiteralType = Float
|
|
|
|
|
|
public let value: Float
|
|
|
@@ -65,4 +64,14 @@ public struct ConstraintPriority : ExpressibleByFloatLiteral, Equatable {
|
|
|
public static func ==(lhs: ConstraintPriority, rhs: ConstraintPriority) -> Bool {
|
|
|
return lhs.value == rhs.value
|
|
|
}
|
|
|
+
|
|
|
+ // MARK: Strideable
|
|
|
+
|
|
|
+ public func advanced(by n: FloatLiteralType) -> ConstraintPriority {
|
|
|
+ return ConstraintPriority(floatLiteral: value + n)
|
|
|
+ }
|
|
|
+
|
|
|
+ public func distance(to other: ConstraintPriority) -> FloatLiteralType {
|
|
|
+ return other.value - value
|
|
|
+ }
|
|
|
}
|