1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 13:50:32 +05:30

Fix drawing state issues

This commit is contained in:
Arkadiusz Fal 2022-08-29 17:56:49 +02:00
parent a3940b4271
commit 14cb1958d8
4 changed files with 4 additions and 8 deletions

View File

@ -502,7 +502,7 @@ final class MPVBackend: PlayerBackend {
} }
func didChangeTo() { func didChangeTo() {
setNeedsDrawing(model.presentingPlayer) setNeedsDrawing(true)
if model.musicMode { if model.musicMode {
startMusicMode() startMusicMode()

View File

@ -249,6 +249,7 @@ final class PlayerModel: ObservableObject {
#endif #endif
presentingPlayer = true presentingPlayer = true
setNeedsDrawing(true)
#if os(macOS) #if os(macOS)
Windows.player.open() Windows.player.open()
@ -504,10 +505,7 @@ final class PlayerModel: ObservableObject {
} }
#endif #endif
DispatchQueue.main.asyncAfter(deadline: .now() + delay) { [weak self] in backend.setNeedsDrawing(presentingPlayer)
guard let self = self else { return }
self.backend.setNeedsDrawing(self.presentingPlayer)
}
controls.hide() controls.hide()

View File

@ -89,6 +89,7 @@ extension VideoPlayerView {
withAnimation(Constants.overlayAnimation) { withAnimation(Constants.overlayAnimation) {
viewDragOffset = Self.hiddenOffset viewDragOffset = Self.hiddenOffset
} }
player.backend.setNeedsDrawing(false)
} else { } else {
withAnimation(Constants.overlayAnimation) { withAnimation(Constants.overlayAnimation) {
viewDragOffset = 0 viewDragOffset = 0

View File

@ -126,9 +126,6 @@ struct VideoPlayerView: View {
.onChange(of: geometry.size) { size in .onChange(of: geometry.size) { size in
self.playerSize = size self.playerSize = size
} }
.onChange(of: fullScreenDetails) { value in
player.backend.setNeedsDrawing(!value)
}
#if os(iOS) #if os(iOS)
.frame(width: playerWidth.isNil ? nil : Double(playerWidth!), height: playerHeight.isNil ? nil : Double(playerHeight!)) .frame(width: playerWidth.isNil ? nil : Double(playerWidth!), height: playerHeight.isNil ? nil : Double(playerHeight!))
.ignoresSafeArea(.all, edges: playerEdgesIgnoringSafeArea) .ignoresSafeArea(.all, edges: playerEdgesIgnoringSafeArea)