Search Issue Tracker

Won't Fix

Votes

0

Found in

2018.4

2020.1.0b15

2021.1

Issue ID

1262578

Regression

No

[Android] [WebGL] "Constant Pixel Size" Canvas UI Scale Mode has no effect when changing screen orientation

WebGL

-

Reproduction steps:
1. Download and open the user-submitted project "UnityWebGLGyroscope2.zip"
2. Build for WebGL
3. Create a server using this "python -m http.server" command in the Command Prompt
4. Navigate to the built WebGL page on your Android device using your IPV4 address
5. Change screen orientation to Landscape/Portrait

Expected result: The UI button size remains constant
Actual result: The UI button size changes based on screen orientation

Reproduces on: 2018.4.28f1, 2021.1.0a1

  1. Resolution Note (2021.1.X):

    To ensure that the screen resolution remains consistent when the screen rotates, ensure that the page has a meta viewport tag. The default template creates an appropriate viewport tag by default with the code:

    if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
    // Mobile device style: fill the whole browser client area with the game canvas:
    var meta = document.createElement('meta');
    meta.name = 'viewport';
    meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes';
    document.getElementsByTagName('head')[0].appendChild(meta);
    ...

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.