Skip to content

Conversation

@Megabjarne
Copy link
Contributor

@Megabjarne Megabjarne commented Apr 28, 2025

Before, if clicking somewhere on the brush selection toolbar, or on the egui inspector window, the brush system would still run and process the pointer event, leading to unintended dig designations.

Not sure if this approach is best practice, could do it with a run_if as well if that is more idiomatic

@Megabjarne Megabjarne force-pushed the filter_pointer_events branch from c26f59d to 39af74e Compare April 28, 2025 19:39
@tigerplush
Copy link
Owner

@Megabjarne Very nice! Do you think we could do without the #[allow(clippy::too_many_arguments)] ?

I was thinking that it's a very complex function already and maybe we could redesign it?

I definitely want to remove #[allow(clippy::single_match)] as soon as there are more actions to designate.
Although there is the argument to be had, that we can just fix it later xD

@Megabjarne
Copy link
Contributor Author

I can see if i can restructure it to split and simplify it, would be benefitial for when more features are added later as well 👍

@Megabjarne Megabjarne force-pushed the filter_pointer_events branch from 39af74e to 1763a86 Compare April 29, 2025 20:14
@Megabjarne Megabjarne changed the title skip brush handling if pointer is over an egui element Refactor brush input handling and ignore interactions over egui elements Apr 29, 2025
@Megabjarne Megabjarne force-pushed the filter_pointer_events branch from 1763a86 to 5a6044d Compare April 29, 2025 20:22
@Megabjarne
Copy link
Contributor Author

Okay, separate system for registering inputs, that creates the higher level input events which are then used in the actual brush handler
I also considered adding rectangular selection here but figured this was enough for one PR

@Megabjarne Megabjarne requested a review from tigerplush April 30, 2025 12:13
@tigerplush tigerplush merged commit e4f3476 into tigerplush:main Apr 30, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants