mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-01 10:23:15 +00:00
Adds check for nodes who should rasterize descendants and opts to recurse down the subnode hierarchy in _recursiveSetPreventOrCancelDisplay.
This commit is contained in:
parent
8499bac020
commit
0a6e36a239
@ -1290,13 +1290,13 @@ static void _recursiveSetPreventOrCancelDisplay(ASDisplayNode *node, CALayer *la
|
|||||||
// Set the flag on the node. If this is a pure layer (no node) then this has no effect (plain layers don't support preventing/cancelling display).
|
// Set the flag on the node. If this is a pure layer (no node) then this has no effect (plain layers don't support preventing/cancelling display).
|
||||||
node.preventOrCancelDisplay = flag;
|
node.preventOrCancelDisplay = flag;
|
||||||
|
|
||||||
if (layer) {
|
if (layer && !node.shouldRasterizeDescendants) {
|
||||||
// If there is a layer, recurse down the layer hierarchy to set the flag on descendants. This will cover both layer-based and node-based children.
|
// If there is a layer, recurse down the layer hierarchy to set the flag on descendants. This will cover both layer-based and node-based children.
|
||||||
for (CALayer *sublayer in layer.sublayers) {
|
for (CALayer *sublayer in layer.sublayers) {
|
||||||
_recursiveSetPreventOrCancelDisplay(nil, sublayer, flag);
|
_recursiveSetPreventOrCancelDisplay(nil, sublayer, flag);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// If there is no layer (view not loaded yet), recurse down the subnode hierarchy to set the flag on descendants. This covers only node-based children, but for a node whose view is not loaded it can't possibly have nodeless children.
|
// If there is no layer (view not loaded yet) or this node rasterizes descendants (there won't be a layer tree to traverse), recurse down the subnode hierarchy to set the flag on descendants. This covers only node-based children, but for a node whose view is not loaded it can't possibly have nodeless children.
|
||||||
for (ASDisplayNode *subnode in node.subnodes) {
|
for (ASDisplayNode *subnode in node.subnodes) {
|
||||||
_recursiveSetPreventOrCancelDisplay(subnode, nil, flag);
|
_recursiveSetPreventOrCancelDisplay(subnode, nil, flag);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user