Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to [email protected] #71

Merged
merged 4 commits into from
Jul 8, 2024
Merged

Conversation

v0x0g
Copy link
Contributor

@v0x0g v0x0g commented Jul 4, 2024

@v0x0g v0x0g marked this pull request as draft July 5, 2024 07:04
@v0x0g
Copy link
Contributor Author

v0x0g commented Jul 5, 2024

Upon further testing I realize this is currently incomplete, and does not build, due to changes with the removal of egui::Event::Scroll.

I will attempt to make the appropriate fixes and update my PR shortly.

@emilk
Copy link
Collaborator

emilk commented Jul 5, 2024

See the migration guide for help: https://github.com/emilk/egui/blob/master/CHANGELOG.md#-migration

v0x0g added 2 commits July 7, 2024 11:25
As per emilk/egui#4524.

Tested locally in `v0x0g/rayna`
@v0x0g v0x0g marked this pull request as ready for review July 7, 2024 03:55
@v0x0g
Copy link
Contributor Author

v0x0g commented Jul 7, 2024

@emilk Fixed and updated, everything seems to be working fine. I have just tested:

  • My own app rayna
  • The egui-demo
  • ./check.sh

I bumped the version to 0.14.1, as none of the modifications impact the public API at all.

self.egui_input.events.push(event);
self.egui_input.events.push(egui::Event::MouseWheel {
modifiers,
unit: egui::MouseWheelUnit::Line,
Copy link
Collaborator

@emilk emilk Jul 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really the unit miniquad uses, always? Sadly it is not documented: https://docs.rs/miniquad/latest/src/miniquad/event.rs.html#170

Maybe @not-fl3 knows?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I also noticed that it's not documented there.

I ended up doing some testing and adding dbg!(delta) inside the event handler, which ended up printing multiples of one every time I scrolled: [1.0, 0.0], [-1.0, 0.0], [0.0, 1.0] (every single event was +- 1.0). I tested using both my mouse and trackpad, and got a consistent [1.0, 0.0] for every 'click' of the scroll wheel, so I'm, fairly confident it's in lines.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't :|
On most platforms its just a raw data from an OS message, on some its fixed 1.0/-1.0.
We do not normalize it in any way.

@emilk emilk merged commit bbb0709 into not-fl3:master Jul 8, 2024
4 checks passed
@emilk
Copy link
Collaborator

emilk commented Jul 8, 2024

Published as 0.15.0

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.

3 participants