File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -81,16 +81,26 @@ const fontLoader = (fonts, store) =>
81
81
} )
82
82
83
83
export default function ( App , appData , platformSettings ) {
84
- defaultOptions . stage [ 'w' ] = platformSettings . width ? platformSettings . width : 1920
85
- defaultOptions . stage [ 'h' ] = platformSettings . height ? platformSettings . height : 1080
86
- defaultOptions . stage [ 'precision' ] =
87
- ( platformSettings . width ? platformSettings . width : 1920 ) / 1920
84
+ const { width, height } = platformSettings
85
+
86
+ if ( width && height ) {
87
+ defaultOptions . stage [ 'w' ] = width
88
+ defaultOptions . stage [ 'h' ] = height
89
+ defaultOptions . stage [ 'precision' ] = width / 1920
90
+ }
91
+
92
+ // support for 720p browser
93
+ if ( ! width && ! height && window . innerHeight === 720 ) {
94
+ defaultOptions . stage [ 'w' ] = 1280
95
+ defaultOptions . stage [ 'h' ] = 720
96
+ defaultOptions . stage [ 'precision' ] = 1280 / 1920
97
+ }
88
98
89
99
return class Application extends Lightning . Application {
90
100
constructor ( options ) {
91
101
const config = Deepmerge ( defaultOptions , options )
92
102
// Deepmerge breaks HTMLCanvasElement, so restore the passed in canvas.
93
- if ( options . stage . canvas ) {
103
+ if ( options . stage . canvas ) {
94
104
config . stage . canvas = options . stage . canvas
95
105
}
96
106
super ( config )
You can’t perform that action at this time.
0 commit comments