Merge remote-tracking branch 'upstream/develop' into main

This commit is contained in:
_Bastler 2021-03-26 14:18:47 +01:00
commit 1c558a7b2a
2 changed files with 8 additions and 2 deletions

View File

@ -140,7 +140,7 @@ export class MenuScene extends Phaser.Scene {
this.warningContainer?.destroy(); this.warningContainer?.destroy();
this.warningContainer = null this.warningContainer = null
this.warningContainerTimeout = null this.warningContainerTimeout = null
}, 2000); }, 120000);
} }

View File

@ -73,7 +73,7 @@ class CoWebsiteManager {
private initResizeListeners() { private initResizeListeners() {
const movecallback = (event:MouseEvent) => { const movecallback = (event:MouseEvent) => {
this.verticalMode ? this.height -= event.movementY : this.width -= event.movementX; this.verticalMode ? this.height -= event.movementY / this.getDevicePixelRatio() : this.width -= event.movementX / this.getDevicePixelRatio();
this.fire(); this.fire();
} }
@ -91,6 +91,12 @@ class CoWebsiteManager {
this.resizing = false; this.resizing = false;
}); });
} }
private getDevicePixelRatio(): number {
//on chrome engines, movementX and movementY return global screens coordinates while other browser return pixels
//so on chrome-based browser we need to adjust using 'devicePixelRatio'
return window.navigator.userAgent.includes('Firefox') ? 1 : window.devicePixelRatio;
}
private close(): void { private close(): void {
this.cowebsiteDiv.classList.remove('loaded'); //edit the css class to trigger the transition this.cowebsiteDiv.classList.remove('loaded'); //edit the css class to trigger the transition