mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-29 17:10:31 +00:00
Merge pull request #479 from joostvandijk/rasterized-node-offset
Fix offset issue for rasterized nodes
This commit is contained in:
commit
2a7f45ed40
@ -87,6 +87,13 @@ static void __ASDisplayLayerDecrementConcurrentDisplayCount(BOOL displayIsAsync,
|
||||
// Capture these outside the display block so they are retained.
|
||||
UIColor *backgroundColor = self.backgroundColor;
|
||||
CGRect bounds = self.bounds;
|
||||
|
||||
CGRect frame;
|
||||
|
||||
// If this is the root container node, use a frame with a zero origin to draw into. If not, calculate the correct frame using the node's position, transform and anchorPoint.
|
||||
if (self.shouldRasterizeDescendants) {
|
||||
frame = CGRectMake(0.0f, 0.0f, bounds.size.width, bounds.size.height);
|
||||
} else {
|
||||
CGPoint position = self.position;
|
||||
CGPoint anchorPoint = self.anchorPoint;
|
||||
|
||||
@ -95,7 +102,8 @@ static void __ASDisplayLayerDecrementConcurrentDisplayCount(BOOL displayIsAsync,
|
||||
CGSize scaledBoundsSize = CGSizeApplyAffineTransform(bounds.size, transform);
|
||||
CGPoint origin = CGPointMake(position.x - scaledBoundsSize.width * anchorPoint.x,
|
||||
position.y - scaledBoundsSize.height * anchorPoint.y);
|
||||
CGRect frame = CGRectMake(origin.x, origin.y, bounds.size.width, bounds.size.height);
|
||||
frame = CGRectMake(origin.x, origin.y, bounds.size.width, bounds.size.height);
|
||||
}
|
||||
|
||||
// Get the display block for this node.
|
||||
asyncdisplaykit_async_transaction_operation_block_t displayBlock = [self _displayBlockWithAsynchronous:NO isCancelledBlock:isCancelledBlock rasterizing:YES];
|
||||
|
Loading…
x
Reference in New Issue
Block a user