Repository navigation
Conversation
A Selection-tool click on a component of an unselected group or compound path makes that component the key when every anchor is selected, and does not select the container. A path with only some anchors selected cannot be the key, and dropping an anchor clears one. Align moves that component on its own. Selected anchors move to the key object's edge, including points that lie past it, and the key keeps its shape.
Messhias
left a comment
There was a problem hiding this comment.
Fully selected component can be the alignment key; partial anchors cannot. Checklist ci is ticked.
…change. Those two files are back to the branch point, so the pull request no longer rewrites them and main's copies merge through.
|
Thanks @turtwig, this is careful work and the tests cover each case well. I'm holding it for the project owner rather than merging. The reference app's public documentation of key objects (Align and distribute objects) covers a second Selection-tool click on a selected object, and a key anchor as the last anchor point selected with the Direct Selection tool. It doesn't say that a Selection-tool click on a direct-selected member of a group or compound path makes that member the key and drops the container from the selection, or that selected anchors align to a key object's edge. Those changes alter what a click selects, so whether VectorCraft works this way is the owner's call. If you'd like to chat with us, our Discord is at https://discord.gg/artcraft. |
What and why
A Selection-tool click on a direct-selected component of a group or compound path selected the container.
select.keyrefused a compound-path member, and a path with only some anchors selected could still be the key. Align of that member moved the whole compound. With anchor points selected, Align to the key object used the points' own bounds, so the key object's anchors moved with them.A click on a fully selected component of an unselected group or compound path now makes that component the key and leaves the container unselected. A path with only some anchors selected cannot be a key, and dropping an anchor clears one. Align moves that component on its own. Selected anchors move to the key object's edge, including points that lie past it, and the key keeps its shape. A click on an unselected member in front of a selected one still selects the compound.
How it was tested
a_click_keeps_a_direct_selected_component_as_the_keycovers a click on a direct-selected group member and compound member, and a click on a selected member behind an unselected one.a_click_on_a_partly_selected_path_does_not_make_it_the_keycovers a partial anchor selection.select_key_requires_the_whole_objectandselect_key_rejects_ids_it_cannot_use_and_keeps_the_keycoverselect.keyfor a whole component, a partial path, and a member whose compound is not selected.a_direct_selected_compound_member_aligns_on_its_own,aligning_anchors_to_a_key_object_does_not_distort_it, andaligning_anchors_uses_the_key_objects_edgecover Align of the component and of anchors onto the key's edge.cargo xtask cipassed: fmt, clippy, test, assets, brands, layers, wasm.Checklist
cargo xtask cipasses (fmt, clippy, tests, assets, brands, layers, wasm).unwrap(),expect(),panic!,unreachable!,todo!orunimplemented!outside tests, and no unchecked indexing on data from files, parameters ormessages. Errors are returned as
Resultand shown to the user(why and how).
ASSETS.md.