godot icon indicating copy to clipboard operation
godot copied to clipboard

resizing a shared RectangleShape2D using the editor gizmos doesn't propagate the position offset this change often introduce

Open mieldepoche opened this issue 2 years ago • 3 comments

Godot version

4.0.rc1

System information

linux

Issue description

simplescreenrecorder-2023-02-13_00.08.43.webm

  • since 4.0 (I think?), the gizmo allows one to set the edge position rather than the rect size.
  • As you can see, resizing the shape resource actually moves the CollisionShape2D node to compensate for this.
  • this position offset isn't propagated to the other users of the resource, making them extend or shrink in both directions.
  • imo, this is unwanted behavior. If the positions were corrected automatically, the worst that could happen is the CollisionShape not being rotated in the direction the user expects. The current behavior just feels wrong to me, and tedious to work around.

Steps to reproduce

(see mrp)

  1. add 2 CollisionShapes2D that share the same RectangleShape2D resource
  2. resize one of them
  3. notice that on the other node, the shape's edges grow in both direction

Minimal reproduction project

mrp_resize_rect.zip

mieldepoche avatar Feb 12 '23 23:02 mieldepoche

Introduced by https://github.com/godotengine/godot/pull/37760, cc @KoBeWi.

I do like the way it works for a single rectangle, I wonder how we could preserve this functionality while still fixing this bug.

rburing avatar Feb 13 '23 08:02 rburing

If you hold Alt, the shape resizes in both directions and the position is preserved. I don't think there is reasonable way to affect position of other shapes. Just don't use this on shared shapes xd

KoBeWi avatar Feb 13 '23 09:02 KoBeWi

I don't think there is reasonable way to affect position of other shapes. Just don't use this on shared shapes xd

The problem with this reasoning is that shapes ARE shared by default

Zireael07 avatar Feb 13 '23 10:02 Zireael07