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

Add Pen and Path tool modes to avoid showing all handles #2264

Merged
merged 11 commits into from
Feb 12, 2025

Conversation

4adex
Copy link
Contributor

@4adex 4adex commented Feb 4, 2025

The objective was to provide 3 (2 in case of pen tool) modes for the viewer that changes how the handles are shown of the selected anchors. The specific requirements and intended behaviour is well written in the issue which this closes #2261.
The approach is summarised below -

  • Added overlay_mode_type in options of both tools which can be modified by the radio buttons in the tool options layout.
  • For each tool they are enum which control the behaviour in Overlays tool message.
  • path_overlays is made more modular by giving another argument, which specifies whether all handles, specific handles, frontier handles, or no handles to be drawn.
  • get_selected_segments is for getting the vector of segmentIds of all segments which are associated with selected elements, which is used specifically for implementing mode 2 and 3.
  • For mode 3, the core logic is finding those points which are only attached to one segment in all of the relevant segments, this approach also takes care of base cases like when there is a loop, etc.
  • overlay_bezier_handles utility function is created to avoid repetition of code.

@4adex 4adex changed the title Path tool only show frontier overlays Reduce path editing clutter with options to hide non-selected anchors' handles Feb 7, 2025
@4adex 4adex marked this pull request as ready for review February 7, 2025 08:28
@Keavon
Copy link
Member

Keavon commented Feb 7, 2025

!build

Copy link

github-actions bot commented Feb 7, 2025

📦 Build Complete for 5fae520
https://257d7226.graphite.pages.dev

@Keavon
Copy link
Member

Keavon commented Feb 7, 2025

Marking as draft until the feedback I gave in the screencast sent on Discord is resolved.

@Keavon Keavon marked this pull request as draft February 7, 2025 10:21
@4adex
Copy link
Contributor Author

4adex commented Feb 9, 2025

Changes after first review -

  • While in mode 2 or mode 3, when the new selection (on mouse down) has only anchors, then previous selection of points is stored in saved_points_before_handle_drag in tool_data
  • In mode 3, if only one point is selected then behaviour is of mode 2.
  • While dragging a handle you can also see the opposite handle.

@4adex 4adex marked this pull request as ready for review February 9, 2025 09:24
@Keavon
Copy link
Member

Keavon commented Feb 9, 2025

!build

Copy link

github-actions bot commented Feb 9, 2025

📦 Build Complete for 0e5e56c
https://ecd1b02b.graphite.pages.dev

@Keavon
Copy link
Member

Keavon commented Feb 9, 2025

!build

Copy link

github-actions bot commented Feb 9, 2025

📦 Build Complete for 413e170
https://e79cfb71.graphite.pages.dev

@Keavon
Copy link
Member

Keavon commented Feb 12, 2025

Here are four separate frontiers:

capture

But the current implementation only treats 1 and 4 as frontiers, which means we don't see handles on either end of frontiers 2 and 3. We should see both handles around that unselected point, as a result.

@Keavon Keavon changed the title Reduce path editing clutter with options to hide non-selected anchors' handles Add Pen and Path tool modes to avoid showing all handles Feb 12, 2025
@Keavon Keavon merged commit 20a5f71 into GraphiteEditor:master Feb 12, 2025
4 checks passed
@Keavon
Copy link
Member

Keavon commented Feb 12, 2025

Another issue: in the Pen tool, when not drawing, all handles are shown regardless of mode.

@4adex
Copy link
Contributor Author

4adex commented Feb 12, 2025

will fix this asap in another PR

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.

Reduce path editing clutter with options to hide non-selected anchors' handles
2 participants