mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-09 22:20:41 +00:00
Copy dequeued context
This commit is contained in:
parent
af932e7596
commit
f1f45c61a8
@ -122,22 +122,21 @@ extern BOOL CGPointIsNull(CGPoint point)
|
|||||||
queue.push({self, CGPointMake(0, 0), NO});
|
queue.push({self, CGPointMake(0, 0), NO});
|
||||||
|
|
||||||
while (!queue.empty()) {
|
while (!queue.empty()) {
|
||||||
Context &context = queue.front();
|
Context context = queue.front();
|
||||||
ASLayout *layout = context.layout;
|
|
||||||
queue.pop();
|
queue.pop();
|
||||||
|
|
||||||
if (predicateBlock(layout)) {
|
if (predicateBlock(context.layout)) {
|
||||||
[flattenedSublayouts addObject:[ASLayout layoutWithLayoutableObject:layout.layoutableObject
|
[flattenedSublayouts addObject:[ASLayout layoutWithLayoutableObject:context.layout.layoutableObject
|
||||||
constrainedSizeRange:layout.constrainedSizeRange
|
constrainedSizeRange:context.layout.constrainedSizeRange
|
||||||
size:layout.size
|
size:context.layout.size
|
||||||
position:context.relativePosition
|
position:context.relativePosition
|
||||||
sublayouts:nil
|
sublayouts:nil
|
||||||
flattened:context.flattened]];
|
flattened:context.flattened]];
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ASLayout *sublayout in layout.sublayouts) {
|
for (ASLayout *sublayout in context.layout.sublayouts) {
|
||||||
// Mark layout trees that have already been flattened for future identification of immediate sublayouts
|
// Mark layout trees that have already been flattened for future identification of immediate sublayouts
|
||||||
BOOL flattened = context.flattened ? : layout.flattened;
|
BOOL flattened = context.flattened ? : context.layout.flattened;
|
||||||
queue.push({sublayout, context.relativePosition + sublayout.position, flattened});
|
queue.push({sublayout, context.relativePosition + sublayout.position, flattened});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user