@@ -219,11 +219,14 @@ public final class ChatUserInfoItemNode: ListViewItemNode, ASGestureRecognizerDe
219
219
}
220
220
221
221
public override func gestureRecognizerShouldBegin( _ gestureRecognizer: UIGestureRecognizer ) -> Bool {
222
- let location = gestureRecognizer. location ( in: self . offsetContainer. view)
223
- if let backgroundContent = self . backgroundContent, backgroundContent. frame. contains ( location) {
224
- return true
222
+ if gestureRecognizer. view === self . offsetContainer. view {
223
+ let location = gestureRecognizer. location ( in: self . offsetContainer. view)
224
+ if let backgroundContent = self . backgroundContent, backgroundContent. frame. contains ( location) {
225
+ return true
226
+ }
227
+ return false
225
228
}
226
- return false
229
+ return true
227
230
}
228
231
229
232
@objc private func tapGesture( _ gestureRecognizer: UITapGestureRecognizer ) {
@@ -366,7 +369,7 @@ public final class ChatUserInfoItemNode: ListViewItemNode, ASGestureRecognizerDe
366
369
var estimatedValueOffset : CGFloat = 0.0
367
370
if groupsInCommonCount > 0 {
368
371
groupsValueText = NSMutableAttributedString ( string: item. presentationData. strings. Chat_NonContactUser_GroupsCount ( groupsInCommonCount) , font: Font . semibold ( 13.0 ) , textColor: primaryTextColor)
369
- estimatedValueOffset = avatarImageSize + CGFloat( min ( 2 , max ( 0 , item. groupsInCommonCount - 1 ) ) ) * avatarSpacing + 4.0
372
+ estimatedValueOffset = avatarImageSize + CGFloat( min ( 2 , max ( 0 , item. groupsInCommonCount - 1 ) ) ) * avatarSpacing + 4.0 + 10.0
370
373
} else {
371
374
groupsValueText = NSMutableAttributedString ( string: " " , font: Font . semibold ( 13.0 ) , textColor: primaryTextColor)
372
375
}
@@ -380,7 +383,7 @@ public final class ChatUserInfoItemNode: ListViewItemNode, ASGestureRecognizerDe
380
383
backgroundSize. height += groupsValueLayoutAndApply? . 0 . size. height ?? 0.0
381
384
382
385
maxTitleWidth = max ( maxTitleWidth, groupsTitleLayoutAndApply? . 0 . size. width ?? 0 )
383
- maxValueWidth = max ( maxValueWidth, groupsValueLayoutAndApply? . 0 . size. width ?? 0 + estimatedValueOffset)
386
+ maxValueWidth = max ( maxValueWidth, ( groupsValueLayoutAndApply? . 0 . size. width ?? 0 ) + estimatedValueOffset)
384
387
} else {
385
388
groupsTitleLayoutAndApply = nil
386
389
groupsValueLayoutAndApply = nil
@@ -474,15 +477,15 @@ public final class ChatUserInfoItemNode: ListViewItemNode, ASGestureRecognizerDe
474
477
475
478
var attributeMidpoints : [ CGFloat ] = [ ]
476
479
477
- func appendAttributeMidpoint( titleLayout: TextNodeLayout ? , valueLayout: TextNodeLayout ? ) {
480
+ func appendAttributeMidpoint( titleLayout: TextNodeLayout ? , valueLayout: TextNodeLayout ? , valueOffset : CGFloat = 0.0 ) {
478
481
if let valueLayout {
479
- let midpoint = backgroundSize. width - horizontalContentInset - valueLayout. size. width - attributeSpacing / 2.0
482
+ let midpoint = backgroundSize. width - horizontalContentInset - valueLayout. size. width - valueOffset - attributeSpacing / 2.0
480
483
attributeMidpoints. append ( midpoint)
481
484
}
482
485
}
483
486
appendAttributeMidpoint ( titleLayout: phoneCountryTitleLayoutAndApply? . 0 , valueLayout: phoneCountryValueLayoutAndApply? . 0 )
484
487
appendAttributeMidpoint ( titleLayout: registrationDateTitleLayoutAndApply? . 0 , valueLayout: registrationDateValueLayoutAndApply? . 0 )
485
- appendAttributeMidpoint ( titleLayout: groupsTitleLayoutAndApply? . 0 , valueLayout: groupsValueLayoutAndApply? . 0 )
488
+ appendAttributeMidpoint ( titleLayout: groupsTitleLayoutAndApply? . 0 , valueLayout: groupsValueLayoutAndApply? . 0 , valueOffset : estimatedValueOffset )
486
489
487
490
let middleX = floorToScreenPixels ( attributeMidpoints. min ( ) ?? backgroundSize. width / 2.0 )
488
491
0 commit comments