From 71a79cd65cd1db690dc178c8daccbaf56cf08309 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Thu, 17 Jun 2021 23:22:01 +0400 Subject: [PATCH] Don't call updateAbsoluteRect for off-screen items --- submodules/Display/Source/ListViewItemNode.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/submodules/Display/Source/ListViewItemNode.swift b/submodules/Display/Source/ListViewItemNode.swift index 0f1e3f992f..873e752454 100644 --- a/submodules/Display/Source/ListViewItemNode.swift +++ b/submodules/Display/Source/ListViewItemNode.swift @@ -547,7 +547,10 @@ open class ListViewItemNode: ASDisplayNode, AccessibilityFocusableNode { public func updateFrame(_ frame: CGRect, within containerSize: CGSize) { self.frame = frame - self.updateAbsoluteRect(frame, within: containerSize) + if frame.maxY < 0.0 || frame.minY > containerSize.height { + } else { + self.updateAbsoluteRect(frame, within: containerSize) + } if let extractedBackgroundNode = self.extractedBackgroundNode { extractedBackgroundNode.frame = frame.offsetBy(dx: 0.0, dy: -self.insets.top) }