Skip to content

Lock segment molding to an axis with Shift#4325

Open
Chetansahney wants to merge 1 commit into
GraphiteEditor:masterfrom
Chetansahney:fix/segment-molding-axis-constraint
Open

Lock segment molding to an axis with Shift#4325
Chetansahney wants to merge 1 commit into
GraphiteEditor:masterfrom
Chetansahney:fix/segment-molding-axis-constraint

Conversation

@Chetansahney

Copy link
Copy Markdown

Closes #3760

While molding a path segment with the Path tool, holding Shift now constrains the drag to a single axis (horizontal or vertical), matching the direction-locking behavior of other drag operations in the tool.

Behavior

  • Hold Shift during a segment mold to lock the movement to the dominant screen axis (whichever of X/Y the drag has travelled further along).
  • Release Shift to resume free movement.
  • A "Lock Direction" hint is shown in the status bar while molding.

Implementation

  • mold_handle_positions gains a lock_direction flag; when set, the incoming pointer position is snapped to the grab point's x or y before the drag delta is computed, so the segment moves purely along one axis.
  • The Path tool forwards the existing snap_angle (Shift) key state into the molding branch, where it was previously unused, and adds the corresponding hint.

When molding a path segment with the Path tool, holding Shift now
constrains the drag to the dominant screen axis (purely horizontal or
vertical), mirroring the direction-lock behavior of other drag
operations. A "Lock Direction" hint is shown while molding.

Closes GraphiteEditor#3760

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a "Lock Direction" feature when molding segments in the path tool. By holding the modifier key (Shift), the drag is constrained to the dominant screen axis (purely horizontal or vertical). Dynamic hints have also been updated to display this option. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@Chetansahney Chetansahney changed the title Lock segment molding to an axis with Shift FIX: Lock segment molding to an axis with Shift Jul 10, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@Chetansahney Chetansahney changed the title FIX: Lock segment molding to an axis with Shift Lock segment molding to an axis with Shift Jul 10, 2026
@0HyperCube

Copy link
Copy Markdown
Contributor

The implementation in #3766 is far more complete. It features overlays so you can see where you are aligning to (in your implementation the user just has to guess). It also does not offset the cursor position in such a strange way.

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.

Segment molding Shift key X/Y constraint

2 participants