Skip to content

Add guide lines feature#3644

Open
jsjgdh wants to merge 17 commits intoGraphiteEditor:masterfrom
jsjgdh:new_branch5
Open

Add guide lines feature#3644
jsjgdh wants to merge 17 commits intoGraphiteEditor:masterfrom
jsjgdh:new_branch5

Conversation

@jsjgdh
Copy link
Copy Markdown
Contributor

@jsjgdh jsjgdh commented Jan 16, 2026

Adds feature for guide lines that can be dragged from the rulers to help with alignment .closes #2601
image of guide lines:
image

@jsjgdh jsjgdh marked this pull request as ready for review January 16, 2026 15:18
@jsjgdh jsjgdh changed the title Added guide lines feature with ruler drag interaction Add guide lines feature Jan 16, 2026
@jsjgdh jsjgdh marked this pull request as draft January 16, 2026 16:46
@0HyperCube
Copy link
Copy Markdown
Contributor

0HyperCube commented Jan 17, 2026

It still looks strange when rotating a document with guides in:

rotating_document_with_guide.mp4

Also the snapping doesn't work when the document is rotated.

Copy link
Copy Markdown
Contributor

@0HyperCube 0HyperCube left a comment

Choose a reason for hiding this comment

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

Seems to work well; I have a few suggestions for the code structure. I won't comment on the JS changes.

Please mark the PR as «Ready to review» when you are happy with it.

@jsjgdh jsjgdh marked this pull request as ready for review January 27, 2026 14:03
@jsjgdh jsjgdh marked this pull request as draft January 27, 2026 14:18
@jsjgdh jsjgdh marked this pull request as ready for review January 27, 2026 14:30
@Keavon
Copy link
Copy Markdown
Member

Keavon commented Feb 1, 2026

!build

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 1, 2026

📦 Build Complete for f2cb67b
https://c16f0eb0.graphite.pages.dev

@Keavon
Copy link
Copy Markdown
Member

Keavon commented Feb 1, 2026

Some of the ~750 lines of code is for snapping, right? At least when I glanced over it last, I thought I saw that. In testing this build link, I am not seeing any snapping to objects in the document.

The "Move Guide" hint should be removed since the user is already dragging the guide.

More review to follow when I have time. My previously stated concern that the line count seems way too high still applies and I'm hesitant to merge it before that can be either resolved or justified to me as to why it's about double the number of lines I would expect from this feature.

@0HyperCube
Copy link
Copy Markdown
Contributor

The snapping changes are from the object to the guide. For example when drawing a rectangle:
Snapping a rectangle to a guide intersection

I suppose it could also be useful to snap the origin of the guide when you are placing it (to match inkscape's features).

I'm not sure how you have determined that exactly 376 lines is the required number to implement this feature? However I guess I will defer to your superior knowledge on this matter.

Comment on lines +609 to +611
let transform = document
.navigation_handler
.calculate_offset_transform(viewport.center_in_viewport_space().into(), &document.document_ptz);
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.

Please use document.metadata().transform_to_viewport directly. There should be no need to use the calculate_offset_transform anywhere in your code since it is already cached.

@Keavon Keavon force-pushed the master branch 6 times, most recently from d6228da to e58c1de Compare March 16, 2026 23:03
@Keavon Keavon force-pushed the master branch 5 times, most recently from 9b97ab7 to 2e842cb Compare March 19, 2026 11:00
@jsjgdh
Copy link
Copy Markdown
Contributor Author

jsjgdh commented Apr 1, 2026

This PR is opened for preview purposes only to show how the feature will look .

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.

Guide lines

3 participants