mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
@@ -26,11 +26,13 @@ extension NSAttributedString {
|
||||
}
|
||||
|
||||
func textSize(with string: String, font: NSFont) -> CGSize {
|
||||
|
||||
let attributedString:NSAttributedString = NSAttributedString(string: string, attributes: [.font : font])
|
||||
let layout = LabelNode.layoutText(attributedString, CGSize(width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude))
|
||||
var size:CGSize = layout.0.size
|
||||
size.width = ceil(size.width)
|
||||
size.height = ceil(size.height)
|
||||
|
||||
return size
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user