setCrop & drag : not working together?

Hi all !

I’m trying to get a piece of image (setCrop) and drag it.
I want that the only cropped piece of image be detectable.
But when I put my mouse pointer outside and on the right or bottom of it, it’s detected…
I made a codepen to show this problem.

Any idea on how to fix it ?

Thanks in advance !

This is working as expected. As the docs say, cropping has no impact on the hit area used for input detection (or on physics bodies), it’s purely a visual crop. The underlying image never changes size.

To achieve what you’re trying to do you’ll need to resize the hitarea Rectangle to match the crop rectangle size.

1 Like

Aaargh, the doc…
I corrected the codepen.
Thank you Rich for your fast reply !