Move declaration/initialization of attributes dictionary closer to use

This commit is contained in:
Nate Weaver 2020-04-30 12:11:52 -05:00
parent 070981553d
commit 951ffeb899
1 changed files with 2 additions and 2 deletions

View File

@ -225,8 +225,6 @@ extension NSAttributedString {
let currentDescriptor = currentFont.fontDescriptor
var descriptor = currentDescriptor.copy() as! FontDescriptor
var attributes: [NSAttributedString.Key: Any] = [:]
var symbolicTraits = currentDescriptor.symbolicTraits
if styles.contains(.bold) {
@ -262,6 +260,8 @@ extension NSAttributedString {
descriptor = descriptor.addingAttributes(descriptorAttributes)
}
var attributes = [NSAttributedString.Key: Any]()
attributes[.font] = Font(descriptor: descriptor, size: baseFont.pointSize)
if styles.contains(.strikethrough) {