mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-21 10:03:03 +00:00
Merge pull request #1319 from nguyenhuy/async_layout_transition_fixes
Fix threadSafeBounds
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -117,7 +117,6 @@ FOUNDATION_EXPORT NSString * const ASRenderingEngineDidDisplayNodesScheduledBefo
|
||||
ASDisplayNodeDidLoadBlock _nodeLoadedBlock;
|
||||
Class _viewClass;
|
||||
Class _layerClass;
|
||||
BOOL _usesDisplayView;
|
||||
|
||||
UIImage *_placeholderImage;
|
||||
CALayer *_placeholderLayer;
|
||||
|
||||
Reference in New Issue
Block a user