Skip to content

Commit

Permalink
Merge pull request #288 from rdkcentral/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
erikhaandrikman authored Dec 13, 2021
2 parents 805784b + d0c2dfe commit 6d23940
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 8 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## v4.8.1

*13 dec 2021*

- Fixed auto detect 720p resolution


## v4.8.0

*7 dec 2021*
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v4.8.1

*13 dec 2021*

- Fixed auto detect 720p resolution

## v4.8.0

*7 dec 2021*
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
20 changes: 15 additions & 5 deletions src/Application/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6d23940

Please sign in to comment.