mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-10-21 17:01:25 -07:00
Fix macOS overlay binding and subtitle alignment
This commit is contained in:
1 parent
1d36409fc7
commit
ee21c77fd0
6 files changed
+382
-25
No files matched your search
@@ -347,6 +347,7 @@ const shouldToggleMouseIgnore = !isLinuxPlatform;
|
||||
const INVISIBLE_POSITION_EDIT_TOGGLE_CODE = "KeyP";
|
||||
const INVISIBLE_POSITION_STEP_PX = 1;
|
||||
const INVISIBLE_POSITION_STEP_FAST_PX = 4;
|
||||
const INVISIBLE_MACOS_VERTICAL_NUDGE_PX = 4;
|
||||
|
||||
let isOverSubtitle = false;
|
||||
let isDragging = false;
|
||||
@@ -1062,6 +1063,14 @@ function applyInvisibleSubtitleLayoutFromMpvMetrics(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isMacOSPlatform && vAlign === 0) {
|
||||
const currentBottom = parseFloat(subtitleContainer.style.bottom);
|
||||
if (Number.isFinite(currentBottom)) {
|
||||
subtitleContainer.style.bottom = `${Math.max(0, currentBottom + INVISIBLE_MACOS_VERTICAL_NUDGE_PX)}px`;
|
||||
}
|
||||
}
|
||||
|
||||
invisibleLayoutBaseLeftPx = parseFloat(subtitleContainer.style.left) || 0;
|
||||
invisibleLayoutBaseBottomPx = Number.isFinite(parseFloat(subtitleContainer.style.bottom))
|
||||
? parseFloat(subtitleContainer.style.bottom)
|
||||
|
||||
Reference in new issue
Block a user