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