Support PixelDimensions

This commit is contained in:
Ali
2019-11-03 00:44:55 +04:00
parent 730b8c17c4
commit a66f13d969
82 changed files with 361 additions and 270 deletions

View File

@@ -1,8 +1,27 @@
public struct PixelDimensions : Equatable {
#if os(iOS)
import UIKit
#endif
public struct PixelDimensions: Equatable {
public let width: Int32
public let height: Int32
public init(width: Int32, height: Int32) {
self.width = width
self.height = height
}
}
#if os(iOS)
public extension PixelDimensions {
public init(_ size: CGSize) {
self.init(width: Int32(size.width), height: Int32(size.height))
}
public var cgSize: CGSize {
return CGSize(width: CGFloat(self.width), height: CGFloat(self.height))
}
}
#endif