Don't clear avatar node contents on hide

This commit is contained in:
Ali 2023-07-09 02:26:49 +04:00
parent 66a8c7e4a7
commit b47a8191c8
4 changed files with 7 additions and 1 deletions

View File

@ -2998,7 +2998,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) {
if ([self _implementsDisplay]) { if ([self _implementsDisplay]) {
if (nowDisplay) { if (nowDisplay) {
[ASDisplayNode scheduleNodeForRecursiveDisplay:self]; [ASDisplayNode scheduleNodeForRecursiveDisplay:self];
} else { } else if (!self.disableClearContentsOnHide) {
[[self asyncLayer] cancelAsyncDisplay]; [[self asyncLayer] cancelAsyncDisplay];
//schedule clear contents on next runloop //schedule clear contents on next runloop
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{

View File

@ -567,6 +567,8 @@ AS_EXTERN NSInteger const ASDefaultDrawingPriority;
*/ */
@property BOOL automaticallyRelayoutOnLayoutMarginsChanges; @property BOOL automaticallyRelayoutOnLayoutMarginsChanges;
@property (nonatomic) bool disableClearContentsOnHide;
@end @end
/** /**

View File

@ -296,6 +296,7 @@ public final class AvatarNode: ASDisplayNode {
self.isOpaque = false self.isOpaque = false
self.displaysAsynchronously = true self.displaysAsynchronously = true
self.disableClearContentsOnHide = true
self.imageNode.isLayerBacked = true self.imageNode.isLayerBacked = true
self.addSubnode(self.imageNode) self.addSubnode(self.imageNode)

View File

@ -275,6 +275,9 @@ private final class PeerInfoScreenMemberItemNode: PeerInfoScreenItemNode {
} else if item.context.account.peerId == item.member.id { } else if item.context.account.peerId == item.member.id {
highlight = false highlight = false
} }
if let point, let itemNode = self.itemNode, let value = itemNode.view.hitTest(self.view.convert(point, to: itemNode.view), with: nil), value is UIControl {
highlight = false
}
if highlight { if highlight {
self.selectionNode.updateIsHighlighted(true) self.selectionNode.updateIsHighlighted(true)
} else { } else {