Add guide lines feature#3644
Conversation
|
It still looks strange when rotating a document with guides in: rotating_document_with_guide.mp4Also the snapping doesn't work when the document is rotated. |
0HyperCube
left a comment
There was a problem hiding this comment.
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.
|
!build |
|
|
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. |
| let transform = document | ||
| .navigation_handler | ||
| .calculate_offset_transform(viewport.center_in_viewport_space().into(), &document.document_ptz); |
There was a problem hiding this comment.
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.
d6228da to
e58c1de
Compare
9b97ab7 to
2e842cb
Compare
f07c79b to
76938eb
Compare
|
@jsjgdh I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 21 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Co-authored-by: James Lindsay <78500760+0HyperCube@users.noreply.github.com>
Co-authored-by: James Lindsay <78500760+0HyperCube@users.noreply.github.com>
- Fix isInRulerArea to check all four viewport edges (not just one) - Add pointercancel handler to abort guide drag on cancelled interactions - Guard hit_test with guide_lines_visible so hidden guides don't capture hover/drag - Gate intersection snap on guide_lines_visible to match get_snap_lines() behaviour - Validate direction string in create_guide_line; panic on invalid values instead of silently defaulting to vertical

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

image of guide lines: