From 6659cddddd27ca0995d6cbd9247bdbe4ac39e10f Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sun, 11 Sep 2022 22:56:01 +0800 Subject: [PATCH] ctlTooltip // Fix font rendering issue on non-retina displays. - Since macOS 11, AppKit requires that rect origin axis values must be integers (in both direction) in order to make sure fonts are rendered clear. --- Source/Modules/UIModules/TooltipUI/ctlTooltip.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Modules/UIModules/TooltipUI/ctlTooltip.swift b/Source/Modules/UIModules/TooltipUI/ctlTooltip.swift index 2f41fc63..1e298c05 100644 --- a/Source/Modules/UIModules/TooltipUI/ctlTooltip.swift +++ b/Source/Modules/UIModules/TooltipUI/ctlTooltip.swift @@ -168,8 +168,8 @@ public class ctlTooltip: NSWindowController { var bigRect = rect bigRect.size.width += NSFont.systemFontSize bigRect.size.height += NSFont.systemFontSize - rect.origin.x += NSFont.systemFontSize / 2 - rect.origin.y += NSFont.systemFontSize / 2 + rect.origin.x += ceil(NSFont.systemFontSize / 2) + rect.origin.y += ceil(NSFont.systemFontSize / 2) messageText.frame = rect window?.setFrame(bigRect, display: true) messageText.draw(messageText.frame)