Skip to content

Comments

fix. Stylus button press changes tool to Eraser but do not erase.#1428

Open
QubaB wants to merge 2 commits intosaber-notes:mainfrom
QubaB:EraseButtonStylus
Open

fix. Stylus button press changes tool to Eraser but do not erase.#1428
QubaB wants to merge 2 commits intosaber-notes:mainfrom
QubaB:EraseButtonStylus

Conversation

@QubaB
Copy link
Contributor

@QubaB QubaB commented Feb 16, 2025

Some styluses do not send move events when button is pressed. So Eraser do not work.

This change allows switch to eraser by pressing and releasing stylus button (no more holding button), then erasing items work.

Creates new preference, which can change default behavior of pressing button when pen is above screen.

Solves issue #1410

QubaB and others added 2 commits February 16, 2025 14:45
…er do not work.

This change allows switch to eraser by pressing and releasing stylus button (no more holding button), then erasing items work.

Creates new preference, which can change default behavior of pressing button when pen is above screen.

Solves issue saber-notes#1410
@codecov
Copy link

codecov bot commented Mar 11, 2025

Codecov Report

❌ Patch coverage is 37.50000% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.15%. Comparing base (7d60459) to head (04e94e0).
⚠️ Report is 511 commits behind head on main.

Files with missing lines Patch % Lines
lib/pages/editor/editor.dart 16.66% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1428      +/-   ##
==========================================
- Coverage   47.15%   47.15%   -0.01%     
==========================================
  Files         114      114              
  Lines        9002     9018      +16     
==========================================
+ Hits         4245     4252       +7     
- Misses       4757     4766       +9     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

AnErrupTion added a commit to AnErrupTion/saber that referenced this pull request Jan 24, 2026
Copy link
Member

@adil192 adil192 left a comment

Choose a reason for hiding this comment

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

@QubaB Thanks for the fix.

Please add some tests for this behaviour with and without the eraserOnStylusButtonPressAndRelease setting.

Also, the setting is a bit confusing at the moment: I think the most understandable UI would be to have two selection options (in an enum) for "Press stylus button to toggle eraser" and "Hold stylus button down for eraser".

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