mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-29 03:21:29 +00:00
Use ASDisplayNodeScreenScale().
ASImageNode and ASHighlightOverlayLayer were both using [[UIScreen mainScreen] scale] directly. Bad. No cookie. Use ASDisplayNodeScreenScale() instead. (Also, regenerate Xcode project with Xcode 6 and current CocoaPods.)
This commit is contained in:
parent
d01fb5f418
commit
367b6da116
File diff suppressed because it is too large
Load Diff
@ -47,7 +47,7 @@ BOOL ASDisplayNodeSubclassOverridesSelector(Class subclass, SEL selector)
|
||||
return (superclassIMP != subclassIMP);
|
||||
}
|
||||
|
||||
static CGFloat ASDisplayNodeScreenScale()
|
||||
CGFloat ASDisplayNodeScreenScale()
|
||||
{
|
||||
static CGFloat screenScale = 0.0;
|
||||
static dispatch_once_t onceToken;
|
||||
|
||||
@ -8,10 +8,11 @@
|
||||
|
||||
#import "ASImageNode.h"
|
||||
|
||||
#import <AsyncDisplayKit/_ASDisplayLayer.h>
|
||||
#import <AsyncDisplayKit/_ASCoreAnimationExtras.h>
|
||||
#import <AsyncDisplayKit/_ASDisplayLayer.h>
|
||||
#import <AsyncDisplayKit/ASAssert.h>
|
||||
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
|
||||
#import <AsyncDisplayKit/ASDisplayNodeInternal.h>
|
||||
|
||||
#import "ASImageNode+CGExtras.h"
|
||||
|
||||
@ -83,7 +84,7 @@
|
||||
return nil;
|
||||
|
||||
// TODO can this be removed?
|
||||
self.contentsScale = [[UIScreen mainScreen] scale];
|
||||
self.contentsScale = ASDisplayNodeScreenScale();
|
||||
self.contentMode = UIViewContentModeScaleAspectFill;
|
||||
self.opaque = YES;
|
||||
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import <AsyncDisplayKit/ASDisplayNodeInternal.h>
|
||||
|
||||
static const CGFloat kCornerRadius = 2.5;
|
||||
static const UIEdgeInsets padding = {2, 4, 1.5, 4};
|
||||
|
||||
@ -21,7 +23,7 @@ static const UIEdgeInsets padding = {2, 4, 1.5, 4};
|
||||
+ (id)defaultValueForKey:(NSString *)key
|
||||
{
|
||||
if ([key isEqualToString:@"contentsScale"]) {
|
||||
return [NSNumber numberWithFloat:[[UIScreen mainScreen] scale]];
|
||||
return @(ASDisplayNodeScreenScale());
|
||||
} else if ([key isEqualToString:@"highlightColor"]) {
|
||||
CGFloat components[] = {0, 0, 0, 0.25};
|
||||
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
|
||||
@ -19,6 +19,7 @@
|
||||
#import "ASThread.h"
|
||||
|
||||
BOOL ASDisplayNodeSubclassOverridesSelector(Class subclass, SEL selector);
|
||||
CGFloat ASDisplayNodeScreenScale();
|
||||
|
||||
@class _ASPendingState;
|
||||
|
||||
|
||||
@ -7,4 +7,4 @@ DEPENDENCIES:
|
||||
SPEC CHECKSUMS:
|
||||
OCMock: 6db79185520e24f9f299548f2b8b07e41d881bd5
|
||||
|
||||
COCOAPODS: 0.34.2
|
||||
COCOAPODS: 0.34.4
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user