godot icon indicating copy to clipboard operation
godot copied to clipboard

Prevent selecting when a CanvasItem is selected

Open KoBeWi opened this issue 1 year ago • 4 comments

https://github.com/godotengine/godot/pull/86804 made it possible to select CanvasItems when any tool is active. However it has an unwanted side-effect that you can select CanvasItems while another CanvasItem is already selected, if that CanvasItem can't be interacted with using the current tool. This PR prevents that, i.e. trying to move/rotate/scale a "locked" CanvasItem results in no-op. Note that "locked" includes actually locked nodes, nodes inside viewport or invisible nodes.

Fixes #92072

KoBeWi avatar Jun 27 '24 16:06 KoBeWi

CC @ryevdokimov

akien-mga avatar Jun 27 '24 16:06 akien-mga

This is not a hill I'm willing to die on, but I'm curious in your opinion why no-op is preferable to selection in this scenario? From my perspective if the user is trying to move or rotate something for example, why not let them without having to switch to the select tool or use the scene tree dock?

ryevdokimov avatar Jun 27 '24 23:06 ryevdokimov

I think only Select tool should allow selecting. The exception is when you have nothing selected, so selecting is the only option to get started. Once you have a CanvasItem selected, showing a selection box can be unexpected and confusing (like imagine you try to move a node, but forgot to unlock it and wonder why your move tool is selecting things). I could maybe add a toaster message, similar to when you try to move a Control inside Container.

KoBeWi avatar Jun 28 '24 22:06 KoBeWi

Fair enough. I guess it depends on just what your expectations are and what you're used to. I'm personally in the camp of all tools should just always be able to select to prevent: https://github.com/godotengine/godot/issues/87608 and so the behavior is always consistent. No-op to me in general is more confusing, because it lacks any feedback on what is supposed to happen, but if this the direction we go I agree that a toaster message after repeated no-op could be helpful.

ryevdokimov avatar Jun 28 '24 23:06 ryevdokimov

https://github.com/godotengine/godot/assets/2223172/70af52c2-4d7c-43ee-828f-715323a75f8c

KoBeWi avatar Jun 29 '24 17:06 KoBeWi

Thanks!

akien-mga avatar Jul 01 '24 16:07 akien-mga