File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 28
28
29
29
#import " Platforms/CCGL.h"
30
30
31
+ #define CC_MINIMUM_TABLET_SCREEN_DIAGONAL 6.0
32
+
31
33
extern NSString * const CCSetupPixelFormat;
32
34
extern NSString * const CCSetupScreenMode;
33
35
extern NSString * const CCSetupScreenOrientation;
Original file line number Diff line number Diff line change @@ -146,15 +146,14 @@ -(NSInteger) runningDevice
146
146
NSInteger ret=-1 ;
147
147
148
148
#if __CC_PLATFORM_ANDROID
149
-
150
149
151
150
AndroidDisplayMetrics *metrics = [[AndroidDisplayMetrics alloc ] init ];
152
151
[[CCActivity currentActivity ].windowManager.defaultDisplay getMetrics: metrics];
153
152
double yInches= metrics.heightPixels /metrics.ydpi ;
154
153
double xInches= metrics.widthPixels /metrics.xdpi ;
155
154
double diagonalInches = sqrt (xInches*xInches + yInches*yInches);
156
- if (diagonalInches<=6 ){
157
-
155
+ if (diagonalInches<=CC_MINIMUM_TABLET_SCREEN_DIAGONAL ){
156
+
158
157
159
158
if ([CCDirector sharedDirector ].contentScaleFactor > 1.0 )
160
159
{
@@ -173,7 +172,7 @@ -(NSInteger) runningDevice
173
172
{
174
173
ret = CCDeviceiPad;
175
174
}
176
-
175
+
177
176
}
178
177
#elif __CC_PLATFORM_IOS
179
178
You can’t perform that action at this time.
0 commit comments