godot
godot copied to clipboard
resizing a shared RectangleShape2D using the editor gizmos doesn't propagate the position offset this change often introduce
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)
- add 2 CollisionShapes2D that share the same RectangleShape2D resource
- resize one of them
- notice that on the other node, the shape's edges grow in both direction
Minimal reproduction project
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.
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
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