Fixes issue where cheats don’t wrap onto next line correctly

This commit is contained in:
Riley Testut 2019-04-30 15:10:07 -07:00
parent 3e5ebc7c32
commit 7da6a5d8a5

View File

@ -50,7 +50,9 @@ extension CheatTextView
let characterWidth = ("A" as NSString).size(withAttributes: [.font: font]).width let characterWidth = ("A" as NSString).size(withAttributes: [.font: font]).width
let width = characterWidth * CGFloat(format.format.count) let width = characterWidth * CGFloat(format.format.count)
self.textContainer.size = CGSize(width: width, height: 0)
let adjustedInset = (self.bounds.width - self.textContainerInset.left) - width
self.textContainerInset.right = adjustedInset
} }
} }
} }