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

Internal Rust cleanup #13

Open
dabreegster opened this issue Dec 23, 2022 · 1 comment
Open

Internal Rust cleanup #13

dabreegster opened this issue Dec 23, 2022 · 1 comment

Comments

@dabreegster
Copy link
Owner

JsRouteSnapper vs RouteSnapperMap responsibilities are unclear. Waypoint and PathEntry should maybe be the same.

... and other cleanups. The current code is a total mess, basically.

@dabreegster
Copy link
Owner Author

I tried to describe the current behavior as a finite state machine, in the hopes that it'd be easier to understand or visualize. Here are notes, incomplete:

  • how do we characterize current state?
    • list of waypoints (snapped node or free pt)

    • freehand vs snap mode

      • holding shift, or it could be onscreen control
    • area or route mode (and then should we extend or not?)

    • mode

      • neutral
      • hovering on waypt
      • dragging (orig index, current waypt)
      • freehand at a pt
  • try again with states, higher level
    • route mode, extend off
      • 0 points, hovering shows a possible point
      • 1 point, hovering shows a possible route
      • 2 points, hovering only works on existing points
    • area mode
      • < 3 points, hovering shows a possible point
      • at least 3, hovering only works on existing
  • what're the events that happen?
    • mouse moves
      • what do we wind up hovering on?
      • is this a drag or not? (rewrite it)
    • click
      • might mean add a point, or might mean delete existing point
    • dblclick
    • dragstart
    • mouseup (aka dragend)
    • enter key to finish
    • keydown shift
    • keyup shift
  • whats the action and possibly state transition?
  • can we express pairs better?
    • click a free pt, a new waypt, an existing waypt, an intermediate pt

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

No branches or pull requests

1 participant