mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-25 01:38:12 +08:00
Add Path tool support for Alt-dragging an anchor to pull out a fresh equidistant handle pair (#2496)
* Added initial logic for dragging * Alt drag stop makes opposite handle back to its position * Implement new requested behaviour * Fix sharp point bug * Apply suggestions from code review * Add hints --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
fa21385d2c
commit
ab39f3f837
@@ -742,6 +742,7 @@ impl ShapeState {
|
||||
delta: DVec2,
|
||||
equidistant: bool,
|
||||
in_viewport_space: bool,
|
||||
was_alt_dragging: bool,
|
||||
opposite_handle_position: Option<DVec2>,
|
||||
responses: &mut VecDeque<Message>,
|
||||
) {
|
||||
@@ -810,9 +811,11 @@ impl ShapeState {
|
||||
let length = opposing_handle.copied().unwrap_or_else(|| transform.transform_vector2(other_position - anchor_position).length());
|
||||
direction.map_or(other_position - anchor_position, |direction| transform.inverse().transform_vector2(-direction * length))
|
||||
};
|
||||
let modification_type = other.set_relative_position(new_relative);
|
||||
|
||||
responses.add(GraphOperationMessage::Vector { layer, modification_type });
|
||||
if !was_alt_dragging {
|
||||
let modification_type = other.set_relative_position(new_relative);
|
||||
responses.add(GraphOperationMessage::Vector { layer, modification_type });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user