@@ -145,10 +145,11 @@ var DebugGameScalePlugin = /*@__PURE__*/(function (superclass) {
145145 } ;
146146
147147 DebugGameScalePlugin . prototype . render = function render ( ) {
148- var devicePixelRatio = window . devicePixelRatio ;
149- var screen = window . screen ;
150148 var ref = this . game ;
151149 var scale = ref . scale ;
150+ var devicePixelRatio = window . devicePixelRatio ;
151+ var screen = window . screen ;
152+ var visualViewport = window . visualViewport ;
152153 var ref$1 = this . game . renderer ;
153154 var c = ref$1 . gameContext ;
154155 var cx = 0.5 * scale . width ;
@@ -157,7 +158,7 @@ var DebugGameScalePlugin = /*@__PURE__*/(function (superclass) {
157158 var h = 128 ;
158159 var x = ~ ~ Math . max ( 0 , cx - 0.5 * w ) ;
159160 var y = ~ ~ Math . max ( 0 , cy - 0.5 * h ) ;
160- var dy = 16 ;
161+ var dy = 15 ;
161162 var sx = 1 / scale . displayScale . x ;
162163 var sy = 1 / scale . displayScale . y ;
163164
@@ -186,6 +187,15 @@ var DebugGameScalePlugin = /*@__PURE__*/(function (superclass) {
186187 if ( screen ) {
187188 c . fillText ( ( "screen: " + ( screen . width ) + "×" + ( screen . height ) + " [" + ( ( screen . width / screen . height ) . toFixed ( 3 ) ) + "] DPR=" + devicePixelRatio ) , x , ( y += dy ) ) ;
188189 }
190+ if ( visualViewport ) {
191+ var offsetLeft = visualViewport . offsetLeft ;
192+ var offsetTop = visualViewport . offsetTop ;
193+ var width = visualViewport . width ;
194+ var height = visualViewport . height ;
195+ var scale$1 = visualViewport . scale ;
196+
197+ c . fillText ( ( "visualViewport: offsetLeft=" + offsetLeft + " offsetTop=" + offsetTop + " width=" + width + ", height=" + height + " scale=" + scale$1 ) , x , ( y += dy ) ) ;
198+ }
189199 } ;
190200
191201 return DebugGameScalePlugin ;
0 commit comments