@@ -174,8 +174,20 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
174174
175175 _initFrameSize : function ( ) {
176176 var locFrameSize = this . _frameSize ;
177- locFrameSize . width = this . _frame . clientWidth ;
178- locFrameSize . height = this . _frame . clientHeight ;
177+ //To get the most likely for the actual display resolution data
178+ var sWidth = Math . min ( window . screen . availWidth , window . screen . width ) * window . devicePixelRatio ;
179+ var sHeight = Math . min ( window . screen . availHeight , window . screen . height ) * window . devicePixelRatio ;
180+ //Calibration of the actual resolution may be smaller
181+ if ( cc . sys . isMobile && this . _frame . clientWidth >= sWidth * 0.8 ) {
182+ locFrameSize . width = sWidth / window . devicePixelRatio ;
183+ } else {
184+ locFrameSize . width = this . _frame . clientWidth ;
185+ }
186+ if ( cc . sys . isMobile && this . _frame . clientWidth >= sHeight * 0.8 ) {
187+ locFrameSize . height = sHeight / window . devicePixelRatio ;
188+ } else {
189+ locFrameSize . height = this . _frame . clientHeight ;
190+ }
179191 } ,
180192
181193 // hack
@@ -188,7 +200,8 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
188200
189201 _setViewPortMeta : function ( width , height ) {
190202 if ( this . _isAdjustViewPort ) {
191- var viewportMetas = { "user-scalable" : "no" , "maximum-scale" : "1.0" , "initial-scale" : "1.0" } , elems = document . getElementsByName ( "viewport" ) , vp , content ;
203+ var viewportMetas = { "user-scalable" : "no" , "maximum-scale" : "1.0" , "initial-scale" : "1.0" , width : "device-width" } ,
204+ elems = document . getElementsByName ( "viewport" ) , vp , content ;
192205 if ( elems . length == 0 ) {
193206 vp = cc . newElement ( "meta" ) ;
194207 vp . name = "viewport" ;
0 commit comments