mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Support UIViewContentModeCenter with ASImageNode
This commit is contained in:
@@ -181,7 +181,8 @@
|
||||
|| alphaInfo == kCGImageAlphaPremultipliedLast;
|
||||
|
||||
BOOL contentModeSupported = contentMode == UIViewContentModeScaleAspectFill
|
||||
|| contentMode == UIViewContentModeScaleAspectFit;
|
||||
|| contentMode == UIViewContentModeScaleAspectFit
|
||||
|| contentMode == UIViewContentModeCenter;
|
||||
|
||||
CGSize backingSize;
|
||||
CGRect imageDrawRect;
|
||||
|
||||
@@ -309,7 +309,7 @@ static void __ASDisplayLayerDecrementConcurrentDisplayCount(BOOL displayIsAsync,
|
||||
if (stretchable) {
|
||||
ASDisplayNodeSetupLayerContentsWithResizableImage(_layer, image);
|
||||
} else {
|
||||
_layer.contentsScale = image.scale;
|
||||
_layer.contentsScale = self.contentsScale;
|
||||
_layer.contents = (id)image.CGImage;
|
||||
}
|
||||
[self didDisplayAsyncLayer:self.asyncLayer];
|
||||
|
||||
@@ -79,6 +79,7 @@ static const CGFloat kInnerPadding = 10.0f;
|
||||
_imageNode.URL = [NSURL URLWithString:[NSString stringWithFormat:@"http://placekitten.com/%zd/%zd",
|
||||
(NSInteger)roundl(_kittenSize.width),
|
||||
(NSInteger)roundl(_kittenSize.height)]];
|
||||
// _imageNode.contentMode = UIViewContentModeCenter;
|
||||
[self addSubnode:_imageNode];
|
||||
|
||||
// lorem ipsum text, plus some nice styling
|
||||
|
||||
Reference in New Issue
Block a user