[ASControlNode] Upgrades to +setEnableHitTestDebug: to intersect hitTestSlop with parents' bounds+slop, to accurately predict and visualize UIKit event delivery edge cases.

This commit is contained in:
Scott Goodson
2016-03-27 22:02:13 -07:00
parent 3e2414da6f
commit cd493358cc
3 changed files with 45 additions and 16 deletions

View File

@@ -100,12 +100,6 @@
_cropDisplayBounds = CGRectNull;
_placeholderColor = ASDisplayNodeDefaultPlaceholderColor();
if ([ASImageNode shouldShowImageScalingOverlay]) {
_debugLabelNode = [[ASTextNode alloc] init];
_debugLabelNode.layerBacked = YES;
[self addSubnode:_debugLabelNode];
}
return self;
}
@@ -144,6 +138,14 @@
[self invalidateCalculatedLayout];
if (image) {
[self setNeedsDisplay];
if ([ASImageNode shouldShowImageScalingOverlay]) {
ASPerformBlockOnMainThread(^{
_debugLabelNode = [[ASTextNode alloc] init];
_debugLabelNode.layerBacked = YES;
[self addSubnode:_debugLabelNode];
});
}
} else {
self.contents = nil;
}