Arch Linux/Ver. 1.11.1/HTML5/Scale Mode=Fit/Full Screen Is Not Right On Brave Browser?

Hi,

On Arch Linux with Defold version 1.11.1.
When running HTML5 build, full screen is not right?
I have the HTML5 Scale Mode set to “Fit”.

Game window resolution is set to: 960x640.
My computer monitor has a resolution of: 1920x1080.
Browser is: Brave
(works fine in both Firefox and Chrome)

Does Brave browser block something necessary for full screen mode on HTML5?
Let me know, thanks!

Jesse

1 Like

If Brave has something similar to the Chrome and Firefox developer console then maybe you could check for clues there? Perhaps there’s something logged about fullscreen being prevented?

Hi

Looked in Brave browser console for warnings and errors, nothing there.
Below I provide screenshots of the issue:

Jesse

I also use Brave, and see the same thing on OSX. Very weird, since Brave is just Chromium under the hood.

It looks like (purely speculating) maybe there’s a mismatch between device pixels and logical CSS pixels, since it tends to show a large view of the upper-left quadrant. That’s what you’d get if you created a canvas that factors in devicePixelRatio to its intrinsic width & height, but didn’t additionally style it with CSS to limit its size in logical CSS pixels.

1 Like

A quick test shows:

  • window.innerWidth = 893
  • window.devicePixelRatio = 2
  • canvas.width = 1786
  • (all is correct & expected so far)
  • width: 1186px !important on the canvas CSS
    • this is where the problem is coming from - I have no idea how that number is being calculated. It does respond to the available size changing, but it’s always larger than the actual available window.innerWidth
    • 1200 / 903 = 1.329, 1186 / 893 = 1.329 … so it’s always 33% wider than it should be
1 Like