mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-04-13 08:46:35 +08:00
Revert "Use getter and setter of other properties in ASDisplayNode's frame setter."
This reverts commit 93e53bbd87.
This commit is contained in:
@@ -143,12 +143,22 @@
|
||||
ASDisplayNodeAssert(CATransform3DIsIdentity(self.transform), @"Must be an identity transform");
|
||||
#endif
|
||||
|
||||
CGPoint origin = self.bounds.origin;
|
||||
CGPoint anchorPoint = self.anchorPoint;
|
||||
BOOL useLayer = (_layer && ASDisplayNodeThreadIsMain());
|
||||
|
||||
self.bounds = (CGRect){ origin, rect.size };
|
||||
self.position = CGPointMake(rect.origin.x + rect.size.width * anchorPoint.x,
|
||||
rect.origin.y + rect.size.height * anchorPoint.y);
|
||||
CGPoint origin = (useLayer ? _layer.bounds.origin : self.bounds.origin);
|
||||
CGPoint anchorPoint = (useLayer ? _layer.anchorPoint : self.anchorPoint);
|
||||
|
||||
CGRect bounds = (CGRect){ origin, rect.size };
|
||||
CGPoint position = CGPointMake(rect.origin.x + rect.size.width * anchorPoint.x,
|
||||
rect.origin.y + rect.size.height * anchorPoint.y);
|
||||
|
||||
if (useLayer) {
|
||||
_layer.bounds = bounds;
|
||||
_layer.position = position;
|
||||
} else {
|
||||
self.bounds = bounds;
|
||||
self.position = position;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setNeedsDisplay
|
||||
|
||||
Reference in New Issue
Block a user