Skip to content

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

@orjandh

Description

@orjandh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions