@@ -194,6 +194,9 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
194194 } else {
195195 view = cc . view ;
196196 }
197+ if ( view . _orientationChanging ) {
198+ return ;
199+ }
197200
198201 // Check frame size changed or not
199202 var prevFrameW = view . _frameSize . width , prevFrameH = view . _frameSize . height , prevRotated = view . _isRotated ;
@@ -229,7 +232,13 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
229232
230233 _orientationChange : function ( ) {
231234 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 ) ;
233242 } ,
234243
235244 /**
@@ -348,11 +357,6 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
348357 cc . container . style . transformOrigin = '0px 0px 0px' ;
349358 this . _isRotated = true ;
350359 }
351- if ( this . _orientationChanging ) {
352- setTimeout ( function ( ) {
353- cc . view . _orientationChanging = false ;
354- } , 1000 ) ;
355- }
356360 } ,
357361
358362 // hack
@@ -676,8 +680,6 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
676680 if ( cc . sys . isMobile )
677681 this . _adjustViewportMeta ( ) ;
678682
679- // Permit to re-detect the orientation of device.
680- this . _orientationChanging = true ;
681683 // If resizing, then frame size is already initialized, this logic should be improved
682684 if ( ! this . _resizing )
683685 this . _initFrameSize ( ) ;
0 commit comments