mirror of
https://github.com/yattee/yattee.git
synced 2026-10-24 13:42:54 +00:00
Replace UIScreen.main with scene-local context
- List row hairlines read displayScale from the SwiftUI environment - MPV render views take contentScaleFactor from traitCollection and re-apply it on UITraitDisplayScale changes - ExpandedPlayerWindow scales against the presenting view's own height - MPVPiPBridge sizes the PiP layer from the container view's window scene screen (UIScreen.main kept only as a nil-window fallback) - WideScreenPlayerLayout falls back to the offered geometry size - Remote control fullscreen state comes from the player sheet's layout pass via NavigationCoordinator.isWideScreenLayoutActive instead of screen bounds aspect - Orientation TODOs for Dynamic Island side detection and prefersInterfaceOrientationLocked
This commit is contained in:
@@ -622,11 +622,6 @@ final class ExpandedPlayerWindowManager {
|
||||
mainWindow?.subviews.first
|
||||
}
|
||||
|
||||
/// Current window height for calculating transforms
|
||||
private var windowHeight: CGFloat {
|
||||
mainWindow?.bounds.height ?? UIScreen.main.bounds.height
|
||||
}
|
||||
|
||||
/// Applies scale and corner radius to main window based on progress (0 = normal, 1 = fully scaled)
|
||||
func scaleMainWindow(progress: CGFloat) {
|
||||
// Capture the presenting view reference on first call
|
||||
@@ -648,7 +643,7 @@ final class ExpandedPlayerWindowManager {
|
||||
let scale = 1 - scaleAmount
|
||||
|
||||
// Offset to keep the view centered vertically after scaling
|
||||
let offsetY = (windowHeight * scaleAmount) / 2
|
||||
let offsetY = (presentingView.bounds.height * scaleAmount) / 2
|
||||
|
||||
// Apply corner radius proportional to progress
|
||||
presentingView.layer.cornerRadius = clampedProgress * scaledCornerRadius
|
||||
@@ -667,7 +662,7 @@ final class ExpandedPlayerWindowManager {
|
||||
let clampedProgress = max(0, min(1, progress))
|
||||
let scaleAmount = clampedProgress * maxScaleProgress
|
||||
let scale = 1 - scaleAmount
|
||||
let offsetY = (windowHeight * scaleAmount) / 2
|
||||
let offsetY = (presentingView.bounds.height * scaleAmount) / 2
|
||||
let cornerRadius = clampedProgress * scaledCornerRadius
|
||||
|
||||
UIView.animate(withDuration: duration, delay: 0, usingSpringWithDamping: damping, initialSpringVelocity: 0, options: []) {
|
||||
|
||||
Reference in New Issue
Block a user