godot
godot copied to clipboard
Remove rect from Path2D
When Path2D is selected, it shows the standard orange rectangle with scale handles. The handles can be confused for path points and lead to accidental scaling. Also scaling Path2D is not very useful in general.
This PR removes the rect.
Before:
After:
You can still select the path by clicking on its curve.
Removing rect completely has potential drawbacks. The path is not obviously "selected" and you don't see its bounds. While this is a minor problem, an alternative of showing the rect without handles is possible too.
I will admit that I myself have often scaled paths (mostly of polygons) hoping / expecting it would reposition the points as opposed to scale the entire object. That feature would be incredibly useful to me and likely to others. I would go as far as say that that's probably expected behavior for having a bunch of points selected. So I think that would be the best alternative to this PR: to have a custom type of "scaling" to reposition the points.
Removing rect completely has potential drawbacks. The path is not obviously "selected" and you don't see its bounds. While this is a minor problem, an alternative of showing the rect without handles is possible too.
Perhaps it would be possible to make the path orange when it's selected. That way you would stay in theme with having the orange outline around selected nodes and it would also be more clear in situations where you have two different paths with the same bounding rectangle (as example, imagine you have a path that goes in a square with another path that touches the middle of the first path's edges).
https://github.com/godotengine/godot/assets/2223172/d9d0ef9d-7363-48b9-ac8f-145b6f98fa15