mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-25 11:58:11 +08:00
Remove additional boolean for mirroring distance (#965)
Removed the additional boolean for mirroring distance
This commit is contained in:
committed by
Keavon Chambers
parent
cc7ec9409d
commit
e849993f27
@@ -175,12 +175,13 @@ impl ShapeEditor {
|
||||
}
|
||||
|
||||
/// Move the selected points by dragging the mouse.
|
||||
pub fn move_selected_points(&self, delta: DVec2, responses: &mut VecDeque<Message>) {
|
||||
pub fn move_selected_points(&self, delta: DVec2, mirror_distance: bool, responses: &mut VecDeque<Message>) {
|
||||
for layer_path in &self.selected_layers {
|
||||
responses.push_back(
|
||||
DocumentMessage::MoveSelectedManipulatorPoints {
|
||||
layer_path: layer_path.clone(),
|
||||
delta: (delta.x, delta.y),
|
||||
mirror_distance,
|
||||
}
|
||||
.into(),
|
||||
);
|
||||
@@ -193,13 +194,12 @@ impl ShapeEditor {
|
||||
}
|
||||
|
||||
/// Toggle if the handles should mirror angle across the anchor position.
|
||||
pub fn toggle_handle_mirroring_on_selected(&self, toggle_angle: bool, toggle_distance: bool, responses: &mut VecDeque<Message>) {
|
||||
pub fn toggle_handle_mirroring_on_selected(&self, toggle_angle: bool, responses: &mut VecDeque<Message>) {
|
||||
for layer_path in &self.selected_layers {
|
||||
responses.push_back(
|
||||
DocumentMessage::ToggleSelectedHandleMirroring {
|
||||
layer_path: layer_path.clone(),
|
||||
toggle_angle,
|
||||
toggle_distance,
|
||||
}
|
||||
.into(),
|
||||
);
|
||||
@@ -391,7 +391,6 @@ impl ShapeEditor {
|
||||
Operation::SetManipulatorHandleMirroring {
|
||||
layer_path: layer_path.to_vec(),
|
||||
id: bezier_id,
|
||||
mirror_distance: false,
|
||||
mirror_angle: true,
|
||||
}
|
||||
.into(),
|
||||
|
||||
@@ -131,7 +131,6 @@ struct PathToolData {
|
||||
|
||||
drag_start_pos: DVec2,
|
||||
alt_debounce: bool,
|
||||
shift_debounce: bool,
|
||||
}
|
||||
|
||||
impl Fsm for PathToolFsmState {
|
||||
@@ -248,20 +247,16 @@ impl Fsm for PathToolFsmState {
|
||||
tool_data.alt_debounce = alt_pressed;
|
||||
// Only on alt down
|
||||
if alt_pressed {
|
||||
tool_data.shape_editor.toggle_handle_mirroring_on_selected(true, false, responses);
|
||||
tool_data.shape_editor.toggle_handle_mirroring_on_selected(true, responses);
|
||||
}
|
||||
}
|
||||
|
||||
// Determine when shift state changes
|
||||
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);
|
||||
}
|
||||
|
||||
// Move the selected points by the mouse position
|
||||
let snapped_position = tool_data.snap_manager.snap_position(responses, document, input.mouse.position);
|
||||
tool_data.shape_editor.move_selected_points(snapped_position - tool_data.drag_start_pos, responses);
|
||||
tool_data.shape_editor.move_selected_points(snapped_position - tool_data.drag_start_pos, shift_pressed, responses);
|
||||
tool_data.drag_start_pos = snapped_position;
|
||||
PathToolFsmState::Dragging
|
||||
}
|
||||
|
||||
@@ -234,7 +234,6 @@ impl Fsm for PenToolFsmState {
|
||||
let op = Operation::SetManipulatorHandleMirroring {
|
||||
layer_path: layer.to_vec(),
|
||||
id,
|
||||
mirror_distance: false,
|
||||
mirror_angle: false,
|
||||
};
|
||||
responses.push_back(op.into());
|
||||
@@ -328,7 +327,6 @@ impl Fsm for PenToolFsmState {
|
||||
let op = Operation::SetManipulatorHandleMirroring {
|
||||
layer_path: layer_path.clone(),
|
||||
id: previous_id,
|
||||
mirror_distance: false,
|
||||
mirror_angle: false,
|
||||
};
|
||||
responses.push_back(op.into());
|
||||
@@ -386,7 +384,6 @@ impl Fsm for PenToolFsmState {
|
||||
let op = Operation::SetManipulatorHandleMirroring {
|
||||
layer_path: layer_path.clone(),
|
||||
id: first_id,
|
||||
mirror_distance: false,
|
||||
mirror_angle: false,
|
||||
};
|
||||
responses.push_back(op.into());
|
||||
@@ -475,7 +472,6 @@ impl Fsm for PenToolFsmState {
|
||||
let op = Operation::SetManipulatorHandleMirroring {
|
||||
layer_path: layer_path.clone(),
|
||||
id: last_id,
|
||||
mirror_distance: should_mirror,
|
||||
mirror_angle: should_mirror,
|
||||
};
|
||||
responses.push_back(op.into());
|
||||
|
||||
Reference in New Issue
Block a user