PCB // Fix errors in manipulating text attributes.
This commit is contained in:
parent
62742e9f82
commit
cf51277625
|
@ -84,6 +84,7 @@ public class PopupCompositionBuffer: NSWindowController {
|
||||||
return newStyle
|
return newStyle
|
||||||
}(),
|
}(),
|
||||||
]
|
]
|
||||||
|
let horizontalAttributes: [NSAttributedString.Key: Any] = [.kern: 0]
|
||||||
|
|
||||||
if isTypingDirectionVertical {
|
if isTypingDirectionVertical {
|
||||||
attrPCBHeader.setAttributes(
|
attrPCBHeader.setAttributes(
|
||||||
|
@ -92,6 +93,13 @@ public class PopupCompositionBuffer: NSWindowController {
|
||||||
attrString.setAttributes(
|
attrString.setAttributes(
|
||||||
verticalAttributes, range: NSRange(location: 0, length: attrString.length)
|
verticalAttributes, range: NSRange(location: 0, length: attrString.length)
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
attrPCBHeader.setAttributes(
|
||||||
|
horizontalAttributes, range: NSRange(location: 0, length: attrPCBHeader.length)
|
||||||
|
)
|
||||||
|
attrString.setAttributes(
|
||||||
|
horizontalAttributes, range: NSRange(location: 0, length: attrString.length)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
let markerAttributes: [NSAttributedString.Key: Any] = {
|
let markerAttributes: [NSAttributedString.Key: Any] = {
|
||||||
|
@ -144,10 +152,6 @@ public class PopupCompositionBuffer: NSWindowController {
|
||||||
attrString.insert(attrPCBHeader, at: 0)
|
attrString.insert(attrPCBHeader, at: 0)
|
||||||
attrString.insert(attrPCBHeader, at: attrString.length)
|
attrString.insert(attrPCBHeader, at: attrString.length)
|
||||||
|
|
||||||
attrString.setAttributes(
|
|
||||||
[.kern: 0], range: NSRange(location: 0, length: attrString.length)
|
|
||||||
)
|
|
||||||
|
|
||||||
textShown = attrString
|
textShown = attrString
|
||||||
messageTextField.maximumNumberOfLines = 1
|
messageTextField.maximumNumberOfLines = 1
|
||||||
if let editor = messageTextField.currentEditor() {
|
if let editor = messageTextField.currentEditor() {
|
||||||
|
|
Loading…
Reference in New Issue