Skip to content

Commit

Permalink
Yoga debug info (TextureGroup#1253)
Browse files Browse the repository at this point in the history
* fix SIMULATE_WEB_RESPONSE not imported TextureGroup#449

* Fix to make rangeMode update in right time

* remove uncessary assert

* Fix collection cell editing bug for iOS 9 & 10

* Revert "Fix collection cell editing bug for iOS 9 & 10"

This reverts commit 06e18a1.

* Add description method for yoga.

* Fix comment
  • Loading branch information
wsdwsd0829 committed Mar 15, 2019
1 parent b8b69c7 commit de11398
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/ASDisplayNode+Beta.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ AS_EXTERN void ASDisplayNodePerformBlockOnEveryYogaChild(ASDisplayNode * _Nullab

@end

@interface ASDisplayNode (YogaDebugging)

- (NSString *)yogaTreeDescription;

@end

@interface ASLayoutElementStyle (Yoga)

- (YGNodeRef)yogaNodeCreateIfNeeded;
Expand Down
16 changes: 16 additions & 0 deletions Source/ASDisplayNode+Yoga.mm
Original file line number Diff line number Diff line change
Expand Up @@ -351,4 +351,20 @@ - (void)calculateLayoutFromYogaRoot:(ASSizeRange)rootConstrainedSize

@end

@implementation ASDisplayNode (YogaDebugging)

- (NSString *)yogaTreeDescription {
return [self _yogaTreeDescription:@""];
}

- (NSString *)_yogaTreeDescription:(NSString *)indent {
auto subtree = [NSMutableString stringWithFormat:@"%@%@\n", indent, self.description];
for (ASDisplayNode *n in self.yogaChildren) {
[subtree appendString:[n _yogaTreeDescription:[indent stringByAppendingString:@"| "]]];
}
return subtree;
}

@end

#endif /* YOGA */

0 comments on commit de11398

Please sign in to comment.