mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Tap gesture should not work over non-edge areas
This commit is contained in:
parent
7c0a92bfb2
commit
37123fdb13
1 changed files with 18 additions and 0 deletions
|
|
@ -149,6 +149,24 @@ public final class GalleryPagerNode: ASDisplayNode, UIScrollViewDelegate, UIGest
|
|||
guard let strongSelf = self else {
|
||||
return .fail
|
||||
}
|
||||
|
||||
let size = strongSelf.bounds
|
||||
|
||||
var highlightedSide: Bool?
|
||||
if point.x < edgeWidth && strongSelf.canGoToPreviousItem() {
|
||||
if strongSelf.items.count > 1 {
|
||||
highlightedSide = false
|
||||
}
|
||||
} else if point.x > size.width - edgeWidth && strongSelf.canGoToNextItem() {
|
||||
if strongSelf.items.count > 1 {
|
||||
highlightedSide = true
|
||||
}
|
||||
}
|
||||
|
||||
if highlightedSide == nil {
|
||||
return .fail
|
||||
}
|
||||
|
||||
if let result = strongSelf.hitTest(point, with: nil), let node = result.asyncdisplaykit_node as? ASButtonNode {
|
||||
return .fail
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue