From 603505ebcfadd41f325351b6ea21ff491dc1ffa4 Mon Sep 17 00:00:00 2001 From: erikhaandrikman Date: Mon, 13 Dec 2021 15:10:15 +0100 Subject: [PATCH 1/3] Fixed auto 720p detection --- src/Application/index.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/Application/index.js b/src/Application/index.js index 0b76b9f1..15beb07a 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 (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) From b841f9e5e020a1c06a260b04a5c09fd02dcc2426 Mon Sep 17 00:00:00 2001 From: erikhaandrikman Date: Mon, 13 Dec 2021 16:24:50 +0100 Subject: [PATCH 2/3] Updated 720p rendering if width and height are not provided --- src/Application/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Application/index.js b/src/Application/index.js index 15beb07a..86e4bcdd 100644 --- a/src/Application/index.js +++ b/src/Application/index.js @@ -90,7 +90,7 @@ export default function(App, appData, platformSettings) { } // support for 720p browser - if (window.innerHeight === 720) { + if (!width && !height && window.innerHeight === 720) { defaultOptions.stage['w'] = 1280 defaultOptions.stage['h'] = 720 defaultOptions.stage['precision'] = 1280 / 1920 From d0c2dfe4110e6af0fa0c29ababd6dec740b35cdf Mon Sep 17 00:00:00 2001 From: erikhaandrikman Date: Mon, 13 Dec 2021 17:16:54 +0100 Subject: [PATCH 3/3] Released version 4.8.1 --- CHANGELOG.md | 7 +++++++ docs/changelog.md | 6 ++++++ docs/package.json | 2 +- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 16 insertions(+), 3 deletions(-) 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",