Skip to content

Commit

Permalink
Revert "added functionality for alt key"
Browse files Browse the repository at this point in the history
This reverts commit f12ba6f.
  • Loading branch information
bakayu authored and Keavon committed Dec 28, 2024
1 parent cccb3e3 commit b0b79be
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions editor/src/messages/tool/tool_messages/path_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,6 @@ struct PathToolData {
drag_start_pos: DVec2,
previous_mouse_position: DVec2,
toggle_colinear_debounce: bool,
equidistant_colinear_debounce: bool,
original_handle_colinear: bool,
opposing_handle_lengths: Option<OpposingHandleLengths>,
/// Describes information about the selected point(s), if any, across one or multiple shapes and manipulator point types (anchor or handle).
/// The available information varies depending on whether `None`, `One`, or `Multiple` points are currently selected.
Expand Down Expand Up @@ -473,28 +471,6 @@ impl PathToolData {
false
}

/// Temporarily converts selected handles to colinear if they are not already colinear.
fn update_equidistant_handle_collinearity(&mut self, equidistant: bool, shape_editor: &mut ShapeState, document: &DocumentMessageHandler, responses: &mut VecDeque<Message>) {
match (equidistant, self.equidistant_colinear_debounce) {
(true, false) => {
let current_angle = shape_editor.selected_manipulator_angles(&document.network_interface);
self.original_handle_colinear = current_angle == ManipulatorAngle::Colinear;

if !self.original_handle_colinear {
shape_editor.convert_selected_manipulators_to_colinear_handles(responses, document);
}
self.equidistant_colinear_debounce = true;
}
(false, true) => {
if !self.original_handle_colinear {
shape_editor.disable_colinear_handles_state_on_selected(&document.network_interface, responses);
}
self.equidistant_colinear_debounce = false;
}
_ => {}
}
}

/// Attempts to get a single selected handle. Also retrieves the position of the anchor it is connected to. Used for the purpose of snapping the angle.
fn try_get_selected_handle_and_anchor(&self, shape_editor: &ShapeState, document: &DocumentMessageHandler) -> Option<(DVec2, DVec2)> {
let (layer, selection) = shape_editor.selected_shape_state.iter().next()?; // Only count selections of a single layer
Expand Down Expand Up @@ -591,8 +567,6 @@ impl PathToolData {
shape_editor.snap(&mut self.snap_manager, &self.snap_cache, document, input, previous_mouse)
};

self.update_equidistant_handle_collinearity(equidistant, shape_editor, document, responses);

let handle_lengths = if equidistant { None } else { self.opposing_handle_lengths.take() };
shape_editor.move_selected_points(handle_lengths, document, snapped_delta, equidistant, responses, true);
self.previous_mouse_position += document_to_viewport.inverse().transform_vector2(snapped_delta);
Expand Down

0 comments on commit b0b79be

Please sign in to comment.