Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scale Manager setZoom() will not set zoom back to one #4633

Closed
lgibson02 opened this issue Jun 30, 2019 · 5 comments
Closed

Scale Manager setZoom() will not set zoom back to one #4633

lgibson02 opened this issue Jun 30, 2019 · 5 comments

Comments

@lgibson02
Copy link

  • Phaser Version: Phaser v3.19.0-beta1

I've found in testing that once you set zoom level above one you aren't able to set it back to one again.

Demo: https://jsfiddle.net/2g0ydpuh/

In the demo an image as added before the scale manager sets zoom to x4, this works as expected but the call directly after to set zoom back to x1 has no effect and the finished image is left at a x4 zoom. Changing that last line's parameter to anything other than one works as expected. For example, setZoom(2) on the last line will correctly make the image finish with a x2 zoom.

The demo runs on 3.18 but the bug is still present in 3.19.0-beta1.

@photonstorm
Copy link
Collaborator

Just leaving this note here as a reminder to myself: this issue is just line 999 needing >=. However, also look at dividing resize sizes by zoom factor too.

@BinaryMoon
Copy link

Happy to help test this if you need it Rich.

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

@BinaryMoon
Copy link

@photonstorm did you also change the zoom factor based on the scale or is this just fixing the originally reported bug? I'd be happy to make a new ticket for my suggestion if that's easier?

@photonstorm
Copy link
Collaborator

This only fixes being able to set the zoom factor back to 1 again, the other bug needs its own issue really.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants