Skip to content

Commit c914785

Browse files
committed
3.4.0
1 parent b2f2ac3 commit c914785

File tree

4 files changed

+29
-9
lines changed

4 files changed

+29
-9
lines changed

dist/phaser-plugin-debug-game-scale.esm.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

dist/phaser-plugin-debug-game-scale.umd.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,11 @@
151151
};
152152

153153
DebugGameScalePlugin.prototype.render = function render () {
154-
var devicePixelRatio = window.devicePixelRatio;
155-
var screen = window.screen;
156154
var ref = this.game;
157155
var scale = ref.scale;
156+
var devicePixelRatio = window.devicePixelRatio;
157+
var screen = window.screen;
158+
var visualViewport = window.visualViewport;
158159
var ref$1 = this.game.renderer;
159160
var c = ref$1.gameContext;
160161
var cx = 0.5 * scale.width;
@@ -163,7 +164,7 @@
163164
var h = 128;
164165
var x = ~~Math.max(0, cx - 0.5 * w);
165166
var y = ~~Math.max(0, cy - 0.5 * h);
166-
var dy = 16;
167+
var dy = 15;
167168
var sx = 1 / scale.displayScale.x;
168169
var sy = 1 / scale.displayScale.y;
169170

@@ -192,6 +193,15 @@
192193
if (screen) {
193194
c.fillText(("screen: " + (screen.width) + "×" + (screen.height) + " [" + ((screen.width / screen.height).toFixed(3)) + "] DPR=" + devicePixelRatio), x, (y += dy));
194195
}
196+
if (visualViewport) {
197+
var offsetLeft = visualViewport.offsetLeft;
198+
var offsetTop = visualViewport.offsetTop;
199+
var width = visualViewport.width;
200+
var height = visualViewport.height;
201+
var scale$1 = visualViewport.scale;
202+
203+
c.fillText(("visualViewport: offsetLeft=" + offsetLeft + " offsetTop=" + offsetTop + " width=" + width + ", height=" + height + " scale=" + scale$1), x, (y += dy));
204+
}
195205
};
196206

197207
return DebugGameScalePlugin;

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "phaser-plugin-debug-game-scale",
33
"description": "Shows Phaser 3 Scale Manager state",
4-
"version": "3.3.0",
4+
"version": "3.4.0",
55
"main": "dist/phaser-plugin-debug-game-scale.umd.js",
66
"module": "dist/phaser-plugin-debug-game-scale.esm.js",
77
"browser": "dist/phaser-plugin-debug-game-scale.umd.js",

0 commit comments

Comments
 (0)