Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 37d4c5e

Browse files
committed
Fixing a bug in both debug tools (image scaling, tappable area) in which I don't check that the overlay exists before creating it.
1 parent a18ffc6 commit 37d4c5e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

AsyncDisplayKit/ASControlNode.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ - (void)addTarget:(id)target action:(SEL)action forControlEvents:(ASControlNodeE
262262
_controlEventDispatchTable = [[NSMutableDictionary alloc] initWithCapacity:kASControlNodeEventDispatchTableInitialCapacity]; // enough to handle common types without re-hashing the dictionary when adding entries.
263263

264264
// only show tap-able areas for views with 1 or more addTarget:action: pairs
265-
if ([ASControlNode enableHitTestDebug]) {
265+
if ([ASControlNode enableHitTestDebug] && _debugHighlightOverlay == nil) {
266266
ASPerformBlockOnMainThread(^{
267267
// add a highlight overlay node with area of ASControlNode + UIEdgeInsets
268268
self.clipsToBounds = NO;

AsyncDisplayKit/ASImageNode.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ - (void)setImage:(UIImage *)image
140140
if (image) {
141141
[self setNeedsDisplay];
142142

143-
if ([ASImageNode shouldShowImageScalingOverlay]) {
143+
if ([ASImageNode shouldShowImageScalingOverlay] && _debugLabelNode == nil) {
144144
ASPerformBlockOnMainThread(^{
145145
_debugLabelNode = [[ASTextNode alloc] init];
146146
_debugLabelNode.layerBacked = YES;

0 commit comments

Comments
 (0)