-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up timing of layout tree flattening/ copying of unflattened tree for Weaver #1157
Changes from 4 commits
584dae2
a23f114
61d26fa
bd6e10a
0ae0b03
3abbfe5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1220,11 +1220,10 @@ - (ASLayout *)calculateLayoutThatFits:(ASSizeRange)constrainedSize | |
} | ||
ASDisplayNodeLogEvent(self, @"computedLayout: %@", layout); | ||
|
||
// Return the (original) unflattened layout if it needs to be stored. The layout will be flattened later on (@see _locked_setCalculatedDisplayNodeLayout:). | ||
// Otherwise, flatten it right away. | ||
if (! [ASDisplayNode shouldStoreUnflattenedLayouts]) { | ||
layout = [layout filteredNodeLayoutTree]; | ||
if ([ASDisplayNode shouldStoreUnflattenedLayouts]) { | ||
_unflattenedLayout = layout; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed offline, there is a risk that the layout here will not be used/applied later on, and Weaver (or any other users of this API) will end up with a wrong unflattened layout. But given it's a debugging feature and should not be used in producation, the risk is small and doesn't warrant the complexity of previous implementation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add some comment about this fact? |
||
} | ||
layout = [layout filteredNodeLayoutTree]; | ||
|
||
return layout; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, this method is not called anywhere.