diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bd6170d..1fc9ecf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## v4.8.1 + +*13 dec 2021* + +- Fixed auto detect 720p resolution + + ## v4.8.0 *7 dec 2021* diff --git a/docs/changelog.md b/docs/changelog.md index ebae9536..26424c97 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,11 @@ # Changelog +## v4.8.1 + +*13 dec 2021* + +- Fixed auto detect 720p resolution + ## v4.8.0 *7 dec 2021* diff --git a/docs/package.json b/docs/package.json index 10f85bec..19e2cdb0 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "@lightningjs/sdk", - "version": "4.8.0", + "version": "4.8.1", "license": "Apache-2.0", "scripts": { "postinstall": "node ./scripts/postinstall.js", diff --git a/package-lock.json b/package-lock.json index de4648ca..91b598ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@lightningjs/sdk", - "version": "4.8.0", + "version": "4.8.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 10f85bec..19e2cdb0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lightningjs/sdk", - "version": "4.8.0", + "version": "4.8.1", "license": "Apache-2.0", "scripts": { "postinstall": "node ./scripts/postinstall.js", diff --git a/src/Application/index.js b/src/Application/index.js index 0b76b9f1..86e4bcdd 100644 --- a/src/Application/index.js +++ b/src/Application/index.js @@ -81,16 +81,26 @@ const fontLoader = (fonts, store) => }) export default function(App, appData, platformSettings) { - defaultOptions.stage['w'] = platformSettings.width ? platformSettings.width : 1920 - defaultOptions.stage['h'] = platformSettings.height ? platformSettings.height : 1080 - defaultOptions.stage['precision'] = - (platformSettings.width ? platformSettings.width : 1920) / 1920 + const { width, height } = platformSettings + + if (width && height) { + defaultOptions.stage['w'] = width + defaultOptions.stage['h'] = height + defaultOptions.stage['precision'] = width / 1920 + } + + // support for 720p browser + if (!width && !height && window.innerHeight === 720) { + defaultOptions.stage['w'] = 1280 + defaultOptions.stage['h'] = 720 + defaultOptions.stage['precision'] = 1280 / 1920 + } return class Application extends Lightning.Application { constructor(options) { const config = Deepmerge(defaultOptions, options) // Deepmerge breaks HTMLCanvasElement, so restore the passed in canvas. - if(options.stage.canvas) { + if (options.stage.canvas) { config.stage.canvas = options.stage.canvas } super(config)