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: long hold pen for lines/shape recognition #1175

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Doublonmousse
Copy link
Collaborator

This is still a draft but I want to be sure that the general structure is correct before going further.
At the moment it always transform the pen path into a line between the start and end position if the gesture is detected.

For now what I'm worried about

  • does the current implementation works without mutation issues on the engine ?
  • I'm not fully sure the use of the OneOffTask is completly correct
  • tweak the settings and test it with touch/pen input (does it work correctly).

Then there is a lot of functionality missing

  • toggle the setting in the UI (and have this propagate into the rest of the code so no power is lost detecting a gesture for nothing)
  • emit shapes with the correct stroke width (and extend it further than just lines, for now I'm not entirely sure how that could be done, there's probably new methods to add to the shaper to be able to do that from a single function call)
  • implement the shape recognizer. For now there is no shape recognizer as I was only searching for a way to make the gesture work. At least the general form of the recognizer should be a `PenPath -> Option' so it either recognizes something and returns it or it doesn't.

Issues : #384 and maybe #120 if the last point is developped further than just lines/not lines

starting from the end result : the action of changing the stroke to a shape with data from the current stroke
Note : the task HAS to exist until the pen is changed to another tool.

This is the condition for stopping to check the condition.

This means that for each long hold, a test is made to see if we can recognize a shape (or more).

If not, then we should reset both methods : start again from scratch on the long hold by event and same thing for the task handle
Still some rough parts to go over (in particular for error handling and potential unwraps) but the API should be pretty stable
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.

1 participant