Skip to content

Conversation

@jsjgdh
Copy link
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
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
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
Member

Keavon commented Feb 1, 2026

!build

@github-actions
Copy link

github-actions bot commented Feb 1, 2026

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

@Keavon
Copy link
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
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
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.

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