From ddd8b5d607b7dfa2f20aa06ee29c5cb1f00780c2 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Mon, 19 Sep 2022 12:50:47 +0800 Subject: [PATCH] ctlIME // Force reinitiate ctlTooltip when show(). --- .../ControllerModules/ctlInputMethod_HandleDisplay.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Modules/ControllerModules/ctlInputMethod_HandleDisplay.swift b/Source/Modules/ControllerModules/ctlInputMethod_HandleDisplay.swift index a3d64931..77946bad 100644 --- a/Source/Modules/ControllerModules/ctlInputMethod_HandleDisplay.swift +++ b/Source/Modules/ControllerModules/ctlInputMethod_HandleDisplay.swift @@ -58,6 +58,12 @@ extension ctlInputMethod { if mgrPrefs.alwaysShowTooltipTextsHorizontally { return .horizontal } return isVerticalTyping ? .vertical : .horizontal }() + // 強制重新初期化,因為 NSAttributedTextView 有顯示滯後性。 + do { + ctlInputMethod.tooltipInstance.hide() + ctlInputMethod.tooltipInstance = .init() + } + // 再設定其文字顯示內容並顯示。 ctlInputMethod.tooltipInstance.show( tooltip: tooltip, at: finalOrigin, bottomOutOfScreenAdjustmentHeight: delta, direction: tooltipContentDirection