From f57355d9147c975b05fcdadfa457b14b17c5211c Mon Sep 17 00:00:00 2001 From: Peter <> Date: Tue, 9 Jul 2019 19:49:26 +0400 Subject: [PATCH] Make scrubber touch area larger --- .../Sources/MediaPlayerScrubbingNode.swift | 35 +++++++------------ 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/submodules/MediaPlayer/Sources/MediaPlayerScrubbingNode.swift b/submodules/MediaPlayer/Sources/MediaPlayerScrubbingNode.swift index 66fa8112da..e5efcb136c 100644 --- a/submodules/MediaPlayer/Sources/MediaPlayerScrubbingNode.swift +++ b/submodules/MediaPlayer/Sources/MediaPlayerScrubbingNode.swift @@ -691,30 +691,19 @@ public final class MediaPlayerScrubbingNode: ASDisplayNode { } override public func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { - var hitBounds = self.bounds - let hitTestSlop = self.hitTestSlop - hitBounds.origin.x += hitTestSlop.left - hitBounds.origin.y += hitTestSlop.top - hitBounds.size.width += -hitTestSlop.left - hitTestSlop.right - hitBounds.size.height += -hitTestSlop.top - hitTestSlop.bottom - - if hitBounds.contains(point) { - switch self.contentNodes { - case let .standard(node): - if let handleNodeContainer = node.handleNodeContainer, handleNodeContainer.isUserInteractionEnabled { - return handleNodeContainer.view - } else { - return nil - } - case let .custom(node): - if let handleNodeContainer = node.handleNodeContainer, handleNodeContainer.isUserInteractionEnabled { - return handleNodeContainer.view - } else { - return nil - } + switch self.contentNodes { + case let .standard(node): + if let handleNodeContainer = node.handleNodeContainer, handleNodeContainer.isUserInteractionEnabled { + return handleNodeContainer.view + } else { + return nil + } + case let .custom(node): + if let handleNodeContainer = node.handleNodeContainer, handleNodeContainer.isUserInteractionEnabled { + return handleNodeContainer.view + } else { + return nil } - } else { - return nil } } }