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

Change force to be Option<f32> instead of f32 #3240

Merged
merged 1 commit into from
Aug 12, 2023

Conversation

lucasmerlin
Copy link
Contributor

Force being 0 having two meanings makes it hard to tell whether it has just been a very light touch or whether no force is provided.

In my drawing app I draw a thick line when pressure is close to 1 or the device has no pressure and a thin line when pressure is close to 0.

Not being able to tell between 0 and None causes bugs where faint strokes suddenly have thick blobs when pressure reaches 0. This could be avoided with some clever logic but the changes in this PR make it a lot easier.

There also is a force variable in MultiTouchInfo but I don't think that one needs to be changed to Option since it's an average. But I could also update it for consitency.

@emilk emilk added eframe Relates to epi and eframe egui labels Aug 11, 2023
@emilk emilk merged commit 1036cb1 into emilk:master Aug 12, 2023
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eframe Relates to epi and eframe egui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants