How to resize GameObjects.Rectangle without changing scale?

Hi,

I have a beautiful GameObjects.Rectangle:
image

The thing is, I can’t properly resize it.
Here are my attempts:

  • Using the setDisplaySize function
    image
    Look at the stroke on the side. The rectangle scale changed, so its stroke render become ugly.

  • Using the setSize function
    image
    Now the stroke is not resized at all, I don’t know why.

To be honest I have some difficulties to understand how shape sizing works. I mean, I thought setSize function to not alter how the shape render (following its comment), but it seems that it does… :thinking:

Thanks for any help :pray:

rect.geom.setSize(W, H);
rect.setSize(W, H).updateDisplayOrigin().updateData();

It works thank you !

Since Phaser v3.50

rect.setSize(W, H);

is sufficient.