Consolidate and rename Graphene data types, and add many comments (#1620)

* Document ProtoNodeInput

* More comments

* Comment improvements

* Comment and split ProtoNodeInput::NodeLambda from ProtoNodeInput::Node

* Combine NodeImplementation into DocumentNodeImplementation

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
This commit is contained in:
Keavon Chambers
2024-02-20 17:53:04 -08:00
committed by GitHub
co-authored by Dennis Kobert
parent dc7de4d973
commit a02b162e30
20 changed files with 468 additions and 467 deletions
@@ -478,14 +478,19 @@ impl Fsm for SelectToolFsmState {
// If the user clicks on a layer that is in their current selection, go into the dragging mode.
// If the user clicks on new shape, make that layer their new selection.
// Otherwise enter the box select mode
let state = if tool_data.pivot.is_over(input.mouse.position) {
let state =
// Dragging the pivot
if tool_data.pivot.is_over(input.mouse.position) {
responses.add(DocumentMessage::StartTransaction);
//tool_data.snap_manager.start_snap(document, input, document.bounding_boxes(), true, true);
//tool_data.snap_manager.add_all_document_handles(document, input, &[], &[], &[]);
SelectToolFsmState::DraggingPivot
} else if let Some(_selected_edges) = dragging_bounds {
}
// Dragging one (or two, forming a corner) of the transform cage bounding box edges
else if let Some(_selected_edges) = dragging_bounds {
responses.add(DocumentMessage::StartTransaction);
tool_data.layers_dragging = selected;
@@ -509,7 +514,9 @@ impl Fsm for SelectToolFsmState {
tool_data.get_snap_candidates(document, input);
SelectToolFsmState::ResizingBounds
} else if rotating_bounds {
}
// Dragging near the transform cage bounding box to rotate it
else if rotating_bounds {
responses.add(DocumentMessage::StartTransaction);
if let Some(bounds) = &mut tool_data.bounding_box_manager {
@@ -531,7 +538,9 @@ impl Fsm for SelectToolFsmState {
tool_data.layers_dragging = selected;
SelectToolFsmState::RotatingBounds
} else if intersection.is_some_and(|intersection| selected.iter().any(|selected_layer| intersection.starts_with(*selected_layer, document.metadata()))) {
}
// Dragging the selected layers around to transform them
else if intersection.is_some_and(|intersection| selected.iter().any(|selected_layer| intersection.starts_with(*selected_layer, document.metadata()))) {
responses.add(DocumentMessage::StartTransaction);
if tool_data.nested_selection_behavior == NestedSelectionBehavior::Deepest {
@@ -545,7 +554,9 @@ impl Fsm for SelectToolFsmState {
tool_data.get_snap_candidates(document, input);
SelectToolFsmState::Dragging
} else {
}
// Dragging a selection box
else {
tool_data.layers_dragging = selected;
if !input.keyboard.key(add_to_selection) {