Firefox zoom support check
This commit is contained in:
parent
5a65086421
commit
20d25afed6
@ -92,9 +92,14 @@ public class HtmlEngine implements GraphicEngine {
|
||||
});
|
||||
onZoom.subscribe((windowZoom) -> {
|
||||
if (windowZoom != 0) {
|
||||
if (suppportsZoom()) {
|
||||
canvas.setWidth((int)(480 / 1));
|
||||
canvas.setHeight((int)(320 / 1));
|
||||
canvas.getStyle().setProperty("zoom", "" + (windowZoom + 1));
|
||||
} else {
|
||||
canvas.setWidth((int)(480 / (windowZoom + 1)));
|
||||
canvas.setHeight((int)(320 / (windowZoom + 1)));
|
||||
}
|
||||
canvas.getStyle().setProperty("max-height", (int)(44 / windowZoom) + "vh");
|
||||
width = 480 / windowZoom.intValue();
|
||||
height = 320 / windowZoom.intValue();
|
||||
@ -199,6 +204,9 @@ public class HtmlEngine implements GraphicEngine {
|
||||
onInitialized.run();
|
||||
}
|
||||
|
||||
@JSBody(params = {}, script = "return CSS.supports(\"zoom:2\")")
|
||||
private native boolean suppportsZoom();
|
||||
|
||||
@Override
|
||||
public int getWidth() {
|
||||
if (width == -1)
|
||||
|
Loading…
Reference in New Issue
Block a user