mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Support PixelDimensions
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user