Restore a scene to it's original size with a button

Hello,

What javascript function can I put to restore a scene to its original size after zooming on a mobile?
the function would be taken into account when you click on a button.
button => on click => execute javascript (which one ?)
Thank you ! :slight_smile:

as far as i can see, there’s no consistent browserwide property to do so.

document.body.style.zoom = "50%"

is a property which runs in safari and chrome, but it seems with inconsistent results …

Great ! it works :slight_smile:
On iphone with Safari certainly, I have not tested for the moment with other browsers, but
it’s a first step. thank you :slight_smile:

Side note: I am had issues with zoom as Hype uses it in the IDE for zooms that are 100% plus. I had to disable it and replace it with a regular transform scale. Reason being that there are edge cases zoom can produce errors in the metrics when combined with transforms. Basically there is a possibility that the transform matrix doesn’t get notified about the zoom level. Just that you have this finding in the back of your mind should you ever run into display errors.

Thank you for this additional information ! :slight_smile:

In my case, it is a form to fill out. But on mobile it was an automatic zoom when filling this form. When validating the form to proceed to the next step: the automatic zoom of the mobile remained, and therefore the next step was enlarged. With this function on the validation click => I come back to a scene at its original size.

1 Like