Merge pull request #1319 from nguyenhuy/async_layout_transition_fixes

Fix threadSafeBounds
This commit is contained in:
appleguy
2016-03-03 16:24:47 -08:00
4 changed files with 8 additions and 7 deletions

View File

@@ -429,13 +429,11 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
ASDisplayNodeAssert(![view isKindOfClass:[_ASDisplayView class]], @"View block should return a synchronously displayed view");
_viewBlock = nil;
_viewClass = [view class];
_usesDisplayView = NO;
} else {
if (!_viewClass) {
_viewClass = [self.class viewClass];
}
view = [[_viewClass alloc] init];
_usesDisplayView = [_viewClass isKindOfClass:[_ASDisplayView class]];
}
return view;

View File

@@ -78,6 +78,12 @@
}
}
- (void)setBounds:(CGRect)bounds
{
[super setBounds:bounds];
self.asyncdisplaykit_node.threadSafeBounds = bounds;
}
#if DEBUG // These override is strictly to help detect application-level threading errors. Avoid method overhead in release.
- (void)setContents:(id)contents
{

View File

@@ -18,6 +18,7 @@
#import "ASEqualityHelpers.h"
#import "ASPendingStateController.h"
#import "ASThread.h"
#import "ASTextNode.h"
/**
* The following macros are conveniences to help in the common tasks related to the bridging that ASDisplayNode does to UIView and CALayer.
@@ -211,10 +212,7 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo
{
_bridge_prologue_write;
_setToViewOrLayer(bounds, newBounds, bounds, newBounds);
// If _ASDisplayView is available, it already sets the new bounds to threadSafeBounds.
if (! (__loaded(self) && _usesDisplayView)) {
self.threadSafeBounds = newBounds;
}
self.threadSafeBounds = newBounds;
}
- (CGRect)frame

View File

@@ -117,7 +117,6 @@ FOUNDATION_EXPORT NSString * const ASRenderingEngineDidDisplayNodesScheduledBefo
ASDisplayNodeDidLoadBlock _nodeLoadedBlock;
Class _viewClass;
Class _layerClass;
BOOL _usesDisplayView;
UIImage *_placeholderImage;
CALayer *_placeholderLayer;