From afc172728f56687dae6ce16e6f4ba121bdd23edd Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 29 Jun 2024 11:31:12 -0500 Subject: [PATCH] macos: offset quicklook box a bit to look better (imo) --- macos/Sources/Ghostty/SurfaceView_AppKit.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/macos/Sources/Ghostty/SurfaceView_AppKit.swift b/macos/Sources/Ghostty/SurfaceView_AppKit.swift index 9a28dc5cf..1cf094d87 100644 --- a/macos/Sources/Ghostty/SurfaceView_AppKit.swift +++ b/macos/Sources/Ghostty/SurfaceView_AppKit.swift @@ -1018,8 +1018,10 @@ extension Ghostty.SurfaceView: NSTextInputClient { // QuickLook var sel: ghostty_selection_s = ghostty_selection_s(); if ghostty_surface_selection_info(surface, &sel) { - x = sel.tl_px_x; - y = sel.tl_px_y; + // The -2/+2 here is subjective. QuickLook seems to offset the rectangle + // a bit and I think these small adjustments make it look more natural. + x = sel.tl_px_x - 2; + y = sel.tl_px_y + 2; } else { ghostty_surface_ime_point(surface, &x, &y) }