Search Issue Tracker
Fixed in 2021.1.X
Fixed in 2020.3.X
Votes
9
Found in
2017.4
2018.4
2019.2
2019.3
2020.1
Issue ID
1178725
Regression
No
[WebGL] Builds don't allow separate control on canvas render buffer size
To reproduce:
1) Create a new project
2) Add a Sphere to the scene (and make it bigger to see the issue better, for example, 5/5/5 in Scale)
3) Switch to WebGL
4) Go to Player Settings
5) Set resolution to 300x300
6) Build and run it
7) Open dev console in the browser
8) Run the following block in it"
document.querySelector('canvas').width = 300;
document.querySelector('canvas').height = 300;
document.querySelector('canvas').style.width = '900px';
document.querySelector('canvas').style.height = '300px';
Expected: The sphere gets stretched (or squished if you set style.width less than 300)
Actual: The sphere stays the same
Reproduced in 2017.4.0f1, 2019.2.2f1, 2020.1.0a1
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (fix version 2021.1):
Fixed in Unity 2021.1.0a2, "matchWebGLToCanvasSize: false;" option was added and should be uncommented in the "index.html" file
Resolution Note (fix version 2020.3):
Fixed in Unity 2020.3.3f1