[HTML5] initial-scale in viewport meta is not considered in chrome fullscreen

My game looks ugly in fullscreen on Android Galaxy S6. If not fullscreen, then ok.
The reason is than initial-scale 0.5 is not cosideren, when set fullscreen. 1280x720 canvas dimensions of canvas become 640x360.
Setting allowHighDpi to true resolves the issue, but has leaks of performance.
Are there any ways to fix this case?

UPD: it would be OK if OpenFL (Lime) handled scaling fine. In this case initial-scale could be remained 1.0. I digged through threads with resampling issue, but no solution found :frowning:

Ok, I found work around:
I commented this in html5 template file

        if (typeof window.devicePixelRatio != 'undefined' && window.devicePixelRatio > 2) {
			var meta = document.getElementsByName ("viewport")[0];
			meta.setAttribute ('content', 'width=device-width, initial-scale=' + (2 / window.devicePixelRatio) + ', user-scalable=no');
		}

And added this to lime HTML5Window.hx

        var element = parent.element;

		if (Reflect.hasField(attributes, "allowHighDPI") && attributes.allowHighDPI && renderType != DOM)
		{
			scale = Browser.window.devicePixelRatio;
		} else
		{
                        //added this condition
			if (Browser.window.devicePixelRatio > 2) {
				scale = Browser.window.devicePixelRatio / 2;
			}
		}

		parent.__scale = scale;

Now I have a new question: is it possible to extend and override lime’s HTML5Window.hx?
I don’t want to modify library classes.

UPD: I’ve extended openfl.display.Window and want to override typedef like this:

#elseif (js && html5)
@:noCompletion private typedef WindowBackend = my.cool.HTML5Window;
#else

But that does nothing.
Still WindowBackend is mapped to lime._internal.backend.html5.HTML5Window

UPD: I just copied HTML5Window.hx to source path of my project with the same package lime._internal.backend.html5

What happens if you keep that condition in Lime but restore that code in the HTML5 template? Does it work okay or does it scale incorrectly at that point?

Is there a performance impact of these changes?

So this leaves the viewport of the browser page alone but scales the content appropriately?

Wait – What if the device pixel ratio is 3… why divide by 2?

Thanks :slight_smile:

I’ll check little bit later.

I don’t know :slight_smile: Currently we have division in template (which I removed) and I noticed number 2 there :smiley:

initial-scale=' + (2 / window.devicePixelRatio)