From 79616abde995f2c56dd08b71932c5053a4d78eb2 Mon Sep 17 00:00:00 2001 From: sudacode Date: Wed, 11 Feb 2026 20:26:26 -0800 Subject: [PATCH] Adjust macOS invisible subtitle vertical nudge --- ...macos-native-window-bounds-for-overlay-binding.md | 4 ++-- src/renderer/positioning.ts | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/backlog/tasks/task-13 - Fix-macos-native-window-bounds-for-overlay-binding.md b/backlog/tasks/task-13 - Fix-macos-native-window-bounds-for-overlay-binding.md index f59524f..d3414b6 100644 --- a/backlog/tasks/task-13 - Fix-macos-native-window-bounds-for-overlay-binding.md +++ b/backlog/tasks/task-13 - Fix-macos-native-window-bounds-for-overlay-binding.md @@ -5,7 +5,7 @@ status: Done assignee: - codex created_date: '2026-02-11 15:45' -updated_date: '2026-02-11 16:20' +updated_date: '2026-02-11 16:28' labels: - bug - macos @@ -40,5 +40,5 @@ Follow-up in progress after packaged app runtime showed fullscreen fallback beha - Added `.asar` helper materialization to temp path so child process execution is possible if candidate path resolves inside asar. - Added throttled tracker logging for helper execution failures to expose runtime errors without log spam. - Updated Electron builder `extraResources` to ship `dist/scripts/get-mpv-window-macos` outside asar at `resources/scripts/get-mpv-window-macos`. -- Added macOS-only invisible subtitle vertical nudge (`+4px`) in renderer layout to align interactive subtitles with mpv glyph baseline after bounds fix. +- Added macOS-only invisible subtitle vertical nudge (`+5px`) in renderer layout to align interactive subtitles with mpv glyph baseline after bounds fix. diff --git a/src/renderer/positioning.ts b/src/renderer/positioning.ts index 9cb3137..3751e81 100644 --- a/src/renderer/positioning.ts +++ b/src/renderer/positioning.ts @@ -1,6 +1,8 @@ import type { MpvSubtitleRenderMetrics, SubtitlePosition } from "../types"; import type { ModalStateReader, RendererContext } from "./context"; +const INVISIBLE_MACOS_VERTICAL_NUDGE_PX = 5; + function clampYPercent(yPercent: number): number { return Math.max(2, Math.min(80, yPercent)); } @@ -365,6 +367,16 @@ export function createPositioningController( ctx.dom.subtitleContainer.style.top = `${Math.max(0, currentTop - halfLeading)}px`; } } + + if (ctx.platform.isMacOSPlatform) { + const currentBottom = parseFloat(ctx.dom.subtitleContainer.style.bottom); + if (Number.isFinite(currentBottom)) { + ctx.dom.subtitleContainer.style.bottom = `${Math.max( + 0, + currentBottom + INVISIBLE_MACOS_VERTICAL_NUDGE_PX, + )}px`; + } + } } function applyInvisibleSubtitleLayoutFromMpvMetrics(