Convert mirror distance to toggle

This commit is contained in:
0hypercube
2022-10-24 21:26:11 +01:00
parent c403847cc3
commit 76b5650022
2 changed files with 7 additions and 5 deletions

View File

@@ -255,7 +255,10 @@ impl Fsm for PathToolFsmState {
let shift_pressed = input.keyboard.get(shift_mirror_distance as usize);
if shift_pressed != tool_data.shift_debounce {
tool_data.shift_debounce = shift_pressed;
tool_data.shape_editor.toggle_handle_mirroring_on_selected(false, true, responses);
// Only on shift down
if shift_pressed {
tool_data.shape_editor.toggle_handle_mirroring_on_selected(false, true, responses);
}
}
// Move the selected points by the mouse position
@@ -392,7 +395,7 @@ impl Fsm for PathToolFsmState {
key_groups: vec![KeysGroup(vec![Key::Shift])],
key_groups_mac: None,
mouse: None,
label: String::from("Share Lengths of Aligned Handles"),
label: String::from("Share Lengths of Aligned Handles (Toggle)"),
plus: false,
},
])]),

View File

@@ -96,8 +96,7 @@ impl ManipulatorGroup {
/// Move the selected points by the provided transform.
pub fn move_selected_points(&mut self, delta: DVec2) {
let mirror_angle = self.editor_state.mirror_angle_between_handles;
// Invert distance since we want it to start disabled
let mirror_distance = !self.editor_state.mirror_distance_between_handles;
let mirror_distance = self.editor_state.mirror_distance_between_handles;
// Move the point absolutely or relatively depending on if the point is under the cursor (the last selected point)
let move_point = |point: &mut ManipulatorPoint, delta: DVec2| {
@@ -299,7 +298,7 @@ impl Default for ManipulatorGroupEditorState {
fn default() -> Self {
Self {
mirror_angle_between_handles: true,
mirror_distance_between_handles: true,
mirror_distance_between_handles: false,
}
}
}