From 177d0c87a364af799749d7b8483ff346822be2a9 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Mon, 12 Feb 2024 14:26:37 +0800 Subject: [PATCH] PCB // Add shadow for cursor. --- .../PopupCompositionBuffer/PopupCompositionBuffer.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Packages/vChewing_PopupCompositionBuffer/Sources/PopupCompositionBuffer/PopupCompositionBuffer.swift b/Packages/vChewing_PopupCompositionBuffer/Sources/PopupCompositionBuffer/PopupCompositionBuffer.swift index 44f46e61..d93ad5e3 100644 --- a/Packages/vChewing_PopupCompositionBuffer/Sources/PopupCompositionBuffer/PopupCompositionBuffer.swift +++ b/Packages/vChewing_PopupCompositionBuffer/Sources/PopupCompositionBuffer/PopupCompositionBuffer.swift @@ -157,10 +157,15 @@ public class PopupCompositionBuffer: NSWindowController { ) var cursorAttributes: [NSAttributedString.Key: Any] { + let shadow = NSShadow() + shadow.shadowBlurRadius = 4 + shadow.shadowOffset.height = 1 + shadow.shadowColor = .black var result: [NSAttributedString.Key: Any] = [ .kern: -18, .font: bufferFont(), .foregroundColor: textColor, + .shadow: shadow, ] if isTypingDirectionVertical { result[.paragraphStyle] = verticalAttributes[.paragraphStyle]