SessionCtl // Use AttributeStrings generated by new methods.
This commit is contained in:
parent
1e27947579
commit
b1f256ef05
|
@ -18,8 +18,8 @@ public extension SessionCtl {
|
|||
// 這樣,不但強制使用(限制讀音 20 個的)浮動組字窗,而且內文組字區只會顯示一個空格。
|
||||
var attributedStringSecured: (value: NSAttributedString, range: NSRange) {
|
||||
clientMitigationLevel >= 2
|
||||
? (state.data.attributedStringPlaceholder, NSRange(location: 0, length: 0))
|
||||
: (state.attributedString, NSRange(state.u16MarkedRange))
|
||||
? (state.data.attributedStringPlaceholder(for: self), NSRange(location: 0, length: 0))
|
||||
: (state.attributedString(for: self), NSRange(state.u16MarkedRange))
|
||||
}
|
||||
|
||||
func lineHeightRect(zeroCursor: Bool = false) -> NSRect {
|
||||
|
|
|
@ -109,11 +109,11 @@ public extension SessionCtl {
|
|||
mitigation: if clientMitigationLevel == 1, state.type == .ofMarking {
|
||||
if !PrefMgr.shared.disableSegmentedThickUnderlineInMarkingModeForManagedClients { break mitigation }
|
||||
let neo = NSMutableAttributedString(attributedString: attributedStringSecured.value)
|
||||
let rangeNeo = NSRange(location: 0, length: neo.string.utf16.count)
|
||||
neo.setAttributes(
|
||||
[
|
||||
.underlineStyle: NSUnderlineStyle.thick.rawValue,
|
||||
.markedClauseSegment: 0,
|
||||
], range: NSRange(location: 0, length: neo.string.utf16.count)
|
||||
mark(forStyle: kTSMHiliteSelectedConvertedText, at: rangeNeo)
|
||||
as? [NSAttributedString.Key: Any]
|
||||
?? [.underlineStyle: NSUnderlineStyle.thick.rawValue], range: rangeNeo
|
||||
)
|
||||
attrStr = neo
|
||||
theRange = NSRange.zero
|
||||
|
|
Loading…
Reference in New Issue