Graphite icon indicating copy to clipboard operation
Graphite copied to clipboard

Further customisation of snapping

Open 0HyperCube opened this issue 1 year ago • 6 comments

Currently the user can only choose to toggle snapping to bounding boxes and snapping to geometry. current snap settings

This should be expanded to allow users to for example ignore snapping to bounding box centres but still snap to corners. State to enable more fine grained snapping is already implemented as part of the BoundsSnapping and NodeSnapping structs. The "Snap customization settings" popup is declared in document_message_handler.rs and the snapping state is stored in misc.rs.

0HyperCube avatar Mar 26 '24 17:03 0HyperCube

@0HyperCube would it be alright to convert bounding_box_snapping and geometry_snapping to maybe enums in which the various fields of BoundsSnapping and PointSnapping are either activated or not. Right now both only have a default implementation. https://github.com/GraphiteEditor/Graphite/blob/438c45eb802e75e41aad5ce0ab055c006563a334/editor/src/messages/portfolio/document/utility_types/misc.rs#L58-L99

shyamjayakannan avatar Apr 10 '24 14:04 shyamjayakannan

@shyamjayakannan I'm not sure what you mean by a maybe enums. The struct here stores these booleans separately as you can snap to many things at the same time, but if you approach keeps this behaviour then it will be fine.

0HyperCube avatar Apr 12 '24 08:04 0HyperCube

Would behavior like that in the video below be alright?

https://github.com/GraphiteEditor/Graphite/assets/120047549/8b1cb1da-5310-480f-8823-c8dd5d6f2049

As can be seen in the video, earlier the cursor was snapping to Bounding Box edges, but turning it off removes the snapping behavior.

I have also removed the checkboxes in front of the Bounding boxes and Geometry options that were present earlier because the snapping can be further customized using the Popover button

shyamjayakannan avatar Apr 15 '24 11:04 shyamjayakannan

That looks great. My only comment is that we don't want recursive popover menus, so please include all those checkboxes in the same menu under the two labeled categories.

Keavon avatar Apr 15 '24 16:04 Keavon

@Keavon will do. Should I make a separate PR or add commits to #1727?

shyamjayakannan avatar Apr 15 '24 18:04 shyamjayakannan

Separate PRs for separate topics.

Keavon avatar Apr 15 '24 19:04 Keavon