mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-01 07:57:01 +00:00
Make scrubber touch area larger
This commit is contained in:
parent
7c7f8759a3
commit
f57355d914
@ -691,30 +691,19 @@ public final class MediaPlayerScrubbingNode: ASDisplayNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override public func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
override public func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
||||||
var hitBounds = self.bounds
|
switch self.contentNodes {
|
||||||
let hitTestSlop = self.hitTestSlop
|
case let .standard(node):
|
||||||
hitBounds.origin.x += hitTestSlop.left
|
if let handleNodeContainer = node.handleNodeContainer, handleNodeContainer.isUserInteractionEnabled {
|
||||||
hitBounds.origin.y += hitTestSlop.top
|
return handleNodeContainer.view
|
||||||
hitBounds.size.width += -hitTestSlop.left - hitTestSlop.right
|
} else {
|
||||||
hitBounds.size.height += -hitTestSlop.top - hitTestSlop.bottom
|
return nil
|
||||||
|
}
|
||||||
if hitBounds.contains(point) {
|
case let .custom(node):
|
||||||
switch self.contentNodes {
|
if let handleNodeContainer = node.handleNodeContainer, handleNodeContainer.isUserInteractionEnabled {
|
||||||
case let .standard(node):
|
return handleNodeContainer.view
|
||||||
if let handleNodeContainer = node.handleNodeContainer, handleNodeContainer.isUserInteractionEnabled {
|
} else {
|
||||||
return handleNodeContainer.view
|
return nil
|
||||||
} else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
case let .custom(node):
|
|
||||||
if let handleNodeContainer = node.handleNodeContainer, handleNodeContainer.isUserInteractionEnabled {
|
|
||||||
return handleNodeContainer.view
|
|
||||||
} else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user