mirror of
https://github.com/yattee/yattee.git
synced 2024-11-10 00:08:21 +00:00
Fix drag gesture
This commit is contained in:
parent
a55683e6bf
commit
4c5ef920b4
@ -17,7 +17,8 @@ extension VideoPlayerView {
|
|||||||
}
|
}
|
||||||
.onChanged { value in
|
.onChanged { value in
|
||||||
guard player.presentingPlayer,
|
guard player.presentingPlayer,
|
||||||
!controlsOverlayModel.presenting else { return }
|
!controlsOverlayModel.presenting,
|
||||||
|
dragGestureState else { return }
|
||||||
|
|
||||||
if player.controls.presentingControls, !player.musicMode {
|
if player.controls.presentingControls, !player.musicMode {
|
||||||
player.controls.presentingControls = false
|
player.controls.presentingControls = false
|
||||||
|
@ -236,7 +236,15 @@ struct VideoPlayerView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var playerOffset: Double {
|
var playerOffset: Double {
|
||||||
dragGestureState && !isHorizontalDrag ? dragGestureOffset.height : viewDragOffset
|
dragGestureState && !isHorizontalDrag ? dragGestureOffset.height : dragOffset
|
||||||
|
}
|
||||||
|
|
||||||
|
var dragOffset: Double {
|
||||||
|
if viewDragOffset.isZero || viewDragOffset == Self.hiddenOffset {
|
||||||
|
return viewDragOffset
|
||||||
|
}
|
||||||
|
|
||||||
|
return player.presentingPlayer ? 0 : Self.hiddenOffset
|
||||||
}
|
}
|
||||||
|
|
||||||
var playerHeight: Double? {
|
var playerHeight: Double? {
|
||||||
|
Loading…
Reference in New Issue
Block a user