@@ -194,6 +194,9 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
194
194
} else {
195
195
view = cc . view ;
196
196
}
197
+ if ( view . _orientationChanging ) {
198
+ return ;
199
+ }
197
200
198
201
// Check frame size changed or not
199
202
var prevFrameW = view . _frameSize . width , prevFrameH = view . _frameSize . height , prevRotated = view . _isRotated ;
@@ -229,7 +232,13 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
229
232
230
233
_orientationChange : function ( ) {
231
234
cc . view . _orientationChanging = true ;
232
- cc . view . _resizeEvent ( ) ;
235
+ if ( cc . sys . isMobile ) {
236
+ cc . game . container . style . display = "none" ;
237
+ }
238
+ setTimeout ( function ( ) {
239
+ cc . view . _orientationChanging = false ;
240
+ cc . view . _resizeEvent ( ) ;
241
+ } , 300 ) ;
233
242
} ,
234
243
235
244
/**
@@ -348,11 +357,6 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
348
357
cc . container . style . transformOrigin = '0px 0px 0px' ;
349
358
this . _isRotated = true ;
350
359
}
351
- if ( this . _orientationChanging ) {
352
- setTimeout ( function ( ) {
353
- cc . view . _orientationChanging = false ;
354
- } , 1000 ) ;
355
- }
356
360
} ,
357
361
358
362
// hack
@@ -676,8 +680,6 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
676
680
if ( cc . sys . isMobile )
677
681
this . _adjustViewportMeta ( ) ;
678
682
679
- // Permit to re-detect the orientation of device.
680
- this . _orientationChanging = true ;
681
683
// If resizing, then frame size is already initialized, this logic should be improved
682
684
if ( ! this . _resizing )
683
685
this . _initFrameSize ( ) ;
0 commit comments