mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-06 17:00:13 +00:00
Fix emoji hit testing
This commit is contained in:
parent
b56132cbc1
commit
eff0b54c19
@ -1553,6 +1553,10 @@ public final class EmojiPagerContentComponent: Component {
|
||||
let position = CGPoint(x: itemLayer.frame.midX, y: itemLayer.frame.midY)
|
||||
let distance = CGPoint(x: localPoint.x - position.x, y: localPoint.y - position.y)
|
||||
let distance2 = distance.x * distance.x + distance.y * distance.y
|
||||
if distance2 > pow(max(itemLayer.bounds.width, itemLayer.bounds.height) / 2.0, 2.0) {
|
||||
continue
|
||||
}
|
||||
|
||||
if let closestItemValue = closestItem {
|
||||
if closestItemValue.distance > distance2 {
|
||||
closestItem = (key, distance2)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user