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

Input debug has the wrong position when a game object has been scaled and the hit area is smaller than the game object #4905

Closed
PavelMishin opened this issue Dec 11, 2019 · 1 comment

Comments

@PavelMishin
Copy link

PavelMishin commented Dec 11, 2019

Version

  • Phaser Version: 3.21.0
  • Operating system: Windows 10
  • Browser: Firefox, Chrome

Description

If the geometry object which used as input shape is smaller than the initial game object size, and the game object is scaled, the input debug graphics position seemed as if the game object was not scaled.

Example Test Code

const image = this.add.image(400, 400, 'test') // test image has 200x200 size for example
image.setScale(0.7)
image.setInteractive(new Phaser.Geom.Circle(100, 100, 80), Phaser.Geom.Circle.Contains)
this.input.enableDebug(image)

Additional Information

If the radius of Circle in the example will be 100, then the debug graphics position will be correct.

I suspect that it's related to the Fix #4722.

@photonstorm photonstorm reopened this Sep 11, 2020
GPopZach pushed a commit to GPopZach/phaser that referenced this issue Sep 16, 2020
…s. This fixes a bug where the Scale Manager would have the incorrect canvas bounds, because they were calculated before a previous canvas was removed from the DOM. Fix phaserjs#4905
lackhand pushed a commit to browndragon/phaser that referenced this issue Sep 17, 2020
…s. This fixes a bug where the Scale Manager would have the incorrect canvas bounds, because they were calculated before a previous canvas was removed from the DOM. Fix phaserjs#4905
@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
Projects
None yet
Development

No branches or pull requests

2 participants