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

snapshotArea function not working properly if size is not integer #6099

Closed
orjandh opened this issue May 6, 2022 · 1 comment
Closed

snapshotArea function not working properly if size is not integer #6099

orjandh opened this issue May 6, 2022 · 1 comment

Comments

@orjandh
Copy link

orjandh commented May 6, 2022

Version

  • Phaser Version: 3.55.2
  • Operating system: Windows 11
  • Browser: Chrome 100, Firefox 100

Description

When using the snapshotArea function and providing a non-integer size, it will either create a distorted snapshot or an empty snapshot. The size of the snapshot image will be the truncated value of the size provided regardless.

I suggest that either the value should be truncated or this can be documented.

Example Test Code

https://labs.phaser.io/edit.html?src=src/snapshot/snapshot%20area.js&v=3.55.2

Change width and height parameter to for example 128.5 or 128.12345.

Additional Information

This may be something that could be patched upstream as well.

@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.

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

2 participants