Allow any node to be identified in the flattened predicate search

This commit is contained in:
Levi McCallum
2016-01-28 23:54:05 -08:00
parent 184d1fc059
commit b2843d29c4

View File

@@ -1606,7 +1606,8 @@ static BOOL ShouldUseNewRenderingRange = YES;
layout = [ASLayout layoutWithLayoutableObject:self size:layout.size sublayouts:@[layout]];
}
return [layout flattenedLayoutUsingPredicateBlock:^BOOL(ASLayout *evaluatedLayout) {
return [_subnodes containsObject:evaluatedLayout.layoutableObject];
return ASObjectIsEqual(layout, evaluatedLayout) == NO &&
[evaluatedLayout.layoutableObject isKindOfClass:[ASDisplayNode class]];
}];
} else {
// If neither -layoutSpecThatFits: nor -calculateSizeThatFits: is overridden by subclassses, preferredFrameSize should be used,