File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -1390,6 +1390,11 @@ class Application extends EventHandler {
1390
1390
this . graphicsDevice . canvas . style . width = width + 'px' ;
1391
1391
this . graphicsDevice . canvas . style . height = height + 'px' ;
1392
1392
1393
+ // In AUTO mode the resolution is changed to match the canvas size
1394
+ if ( this . _resolutionMode === RESOLUTION_AUTO ) {
1395
+ this . setCanvasResolution ( RESOLUTION_AUTO ) ;
1396
+ }
1397
+
1393
1398
// return the final values calculated for width and height
1394
1399
return {
1395
1400
width : width ,
@@ -2141,13 +2146,6 @@ var makeTick = function (_app) {
2141
2146
application . fire ( "framerender" ) ;
2142
2147
2143
2148
if ( application . autoRender || application . renderNextFrame ) {
2144
- // In AUTO mode the resolution is changed to match the canvas size
2145
- if ( application . _resolutionMode === RESOLUTION_AUTO ) {
2146
- // Check if the canvas DOM has changed size
2147
- const canvas = application . graphicsDevice . canvas ;
2148
- application . graphicsDevice . resizeCanvas ( canvas . clientWidth , canvas . clientHeight ) ;
2149
- }
2150
-
2151
2149
application . render ( ) ;
2152
2150
application . renderNextFrame = false ;
2153
2151
}
Original file line number Diff line number Diff line change @@ -3482,7 +3482,6 @@ class GraphicsDevice extends EventHandler {
3482
3482
}
3483
3483
3484
3484
/**
3485
- * @private
3486
3485
* @function
3487
3486
* @name GraphicsDevice#resizeCanvas
3488
3487
* @description Sets the width and height of the canvas, then fires the 'resizecanvas' event.
@@ -3497,8 +3496,8 @@ class GraphicsDevice extends EventHandler {
3497
3496
this . _height = height ;
3498
3497
3499
3498
var ratio = Math . min ( this . _maxPixelRatio , window . devicePixelRatio ) ;
3500
- width = Math . floor ( width * ratio ) ;
3501
- height = Math . floor ( height * ratio ) ;
3499
+ width *= ratio ;
3500
+ height *= ratio ;
3502
3501
3503
3502
if ( this . canvas . width === width && this . canvas . height === height )
3504
3503
return ;
You can’t perform that action at this time.
0 commit comments