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

feat: Add better support for stylus hovering #1355

Merged
merged 2 commits into from
Dec 14, 2024

Conversation

3akev
Copy link
Contributor

@3akev 3akev commented Sep 19, 2024

This PR adds handlers for hovering stylus events, which are used to switch to the eraser tool when the stylus button is pressed while hovering.

This replaces the old functionality where pressing the stylus button mid-stroke removes the stroke, making it more in-line with other note applications and (in my opinion) more user friendly.

Closes #859

Copy link

codecov bot commented Sep 19, 2024

Codecov Report

Attention: Patch coverage is 22.22222% with 21 lines in your changes missing coverage. Please review.

Project coverage is 47.34%. Comparing base (2815bad) to head (ba30f2d).
Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
lib/pages/editor/editor.dart 23.52% 13 Missing ⚠️
lib/components/canvas/canvas_gesture_detector.dart 20.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1355      +/-   ##
==========================================
- Coverage   47.39%   47.34%   -0.05%     
==========================================
  Files         114      114              
  Lines        8959     8976      +17     
==========================================
+ Hits         4246     4250       +4     
- Misses       4713     4726      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adil192
Copy link
Member

adil192 commented Nov 10, 2024

This looks good from the code. What device/s have you tested with? iirc pressing the S-pen button while hovering made the stylus not work temporarily

@3akev
Copy link
Contributor Author

3akev commented Nov 11, 2024

This looks good from the code. What device/s have you tested with? iirc pressing the S-pen button while hovering made the stylus not work temporarily

I tested this on a Galaxy S6 Lite with the S-pen. Unfortunately I don't have access to another device with a stylus, so I can't test this further. It should work on other devices, though.

@ComputerElite
Copy link

Tested on Samsung Galaxy Tab S7 FE with Samsung pen. Works great

@adil192 adil192 merged commit 3037472 into saber-notes:main Dec 14, 2024
2 checks passed
@adil192
Copy link
Member

adil192 commented Dec 14, 2024

Thanks!

@QubaB
Copy link
Contributor

QubaB commented Dec 14, 2024

On my Galaxy Tab S6 is tool changed to Eraser when pressed button, but entities are not erased. So it does not work.

Does erasing work for you? I am using official relase 0.25.3.

@3akev
Copy link
Contributor Author

3akev commented Dec 14, 2024

On my Galaxy Tab S6 is tool changed to Eraser when pressed button, but entities are not erased. So it does not work.

Does erasing work for you? I am using official relase 0.25.3.

I just tested the latest release, 0.25.3 on Galaxy S6 Lite. It appears to be working. Seems this is a rather sneaky bug. Maybe open an issue for it?

@QubaB
Copy link
Contributor

QubaB commented Dec 14, 2024

I have found, that Preference "Automatically switch off Eraser" (do not know precise English name) does not work on my Saber 0.25.3. Even if this preference is switched On or Off, previous tool is used immediately after use of Eraser. I do not know if it can be connected.

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.

Pen buttons on Android
4 participants