diff --git a/apps/desktop/electron/hud-snap-shortcut.ts b/apps/desktop/electron/hud-snap-shortcut.ts index 5da8bb1cb873f..1bc94f44ddfe6 100644 --- a/apps/desktop/electron/hud-snap-shortcut.ts +++ b/apps/desktop/electron/hud-snap-shortcut.ts @@ -18,7 +18,10 @@ export interface HudSnapShortcutController { dispose(): void } -export function createHudSnapShortcut(globalShortcut: GlobalShortcutLike, onSnap: () => void): HudSnapShortcutController { +export function createHudSnapShortcut( + globalShortcut: GlobalShortcutLike, + onSnap: () => void +): HudSnapShortcutController { let active: null | string = null const release = () => { diff --git a/apps/desktop/electron/hud-snap.ts b/apps/desktop/electron/hud-snap.ts index 56bdac13d40e2..947fac1980f4f 100644 --- a/apps/desktop/electron/hud-snap.ts +++ b/apps/desktop/electron/hud-snap.ts @@ -22,11 +22,7 @@ interface Rect { * Window top-left in screen space (DIP) that places `anchor` — a point in the * window's CSS pixels — under `cursor` (screen DIP). */ -export function windowOriginForCursorAnchor( - cursor: Point, - anchor: Point, - zoomFactor: number -): Point { +export function windowOriginForCursorAnchor(cursor: Point, anchor: Point, zoomFactor: number): Point { const scale = Number.isFinite(zoomFactor) && zoomFactor > 0 ? zoomFactor : 1 return { diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts index d743b1f065b0c..467108228551e 100644 --- a/apps/desktop/electron/main.ts +++ b/apps/desktop/electron/main.ts @@ -9226,6 +9226,7 @@ function applyHudSnapToPointer() { const display = screen.getDisplayNearestPoint(cursor) const workArea = display?.workArea ?? bounds const anchor = { x: Math.round(bounds.width / 2), y: HUD_SNAP_ANCHOR_Y } + const origin = snapHudBounds( cursor, anchor,