bevy
bevy copied to clipboard
Improve window cursor usability
Objective
- Let user can use pattern like below when creating window
...
cursor: Cursor {
hit_test: true,
..default()
},
...
- make hit_test default false
The physical_position
field was deliberately made private in #7297. This seems like a regression there.
If not set physical_position
field public, users can't create Cursor by themselves. I thought CursorBuilder
will be a bit heavy, but the solution depends on you.
Maybe we can add comment to warn users not modify physical_position
field directly.
I think we should add a Cursor::new(grab_mode, visible, hit_test, icon)
method, currently if someone wants to modify the cursor of a window they have to construct it with Cursor::default()
and then modify the field they want to change.
Example of someone experiencing this issue. https://discord.com/channels/691052431525675048/1083143550738386984
Closing in favor of https://github.com/bevyengine/bevy/pull/7988.