Revert "Use getter and setter of other properties in ASDisplayNode's frame setter."

This reverts commit 93e53bbd87.
This commit is contained in:
Huy Nguyen
2015-10-01 11:13:49 +03:00
parent 93e53bbd87
commit 22fba5a108

View File

@@ -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