Move declaration/initialization of attributes dictionary closer to use
This commit is contained in:
parent
070981553d
commit
951ffeb899
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue