File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -1331,15 +1331,17 @@ var LibraryGLFW = {
13311331 } ,
13321332
13331333 adjustCanvasDimensions ( ) {
1334- const canvas = Module [ 'canvas' ] ;
1335- var clientWidth = canvas . clientWidth ;
1336- var clientHeight = canvas . clientHeight ;
1337- if ( GLFW . isCSSScalingEnabled ( ) ) {
1338- clientWidth = GLFW . active . width ;
1339- clientHeight = GLFW . active . height ;
1334+ if ( GLFW . active ) {
1335+ const canvas = Module [ 'canvas' ] ;
1336+ var clientWidth = canvas . clientWidth ;
1337+ var clientHeight = canvas . clientHeight ;
1338+ if ( GLFW . isCSSScalingEnabled ( ) ) {
1339+ clientWidth = GLFW . active . width ;
1340+ clientHeight = GLFW . active . height ;
1341+ }
1342+ Browser . updateCanvasDimensions ( canvas , clientWidth , clientHeight ) ;
1343+ Browser . updateResizeListeners ( ) ;
13401344 }
1341- Browser . updateCanvasDimensions ( canvas , clientWidth , clientHeight ) ;
1342- Browser . updateResizeListeners ( ) ;
13431345 } ,
13441346
13451347 getHiDPIScale ( ) {
You can’t perform that action at this time.
0 commit comments