Fixed minor issues related to frontier selection visibility in the Pen/Path tools (#2291)
* Fixed issues * Get back selection when abort --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
parent
419a95e73b
commit
4fe3462af5
|
|
@ -779,6 +779,10 @@ impl Fsm for PathToolFsmState {
|
|||
}
|
||||
PathOverlayMode::FrontierHandles => {
|
||||
let selected_segments = selected_segments(document, shape_editor);
|
||||
let selected_points = shape_editor.selected_points();
|
||||
let selected_anchors = selected_points
|
||||
.filter_map(|point_id| if let ManipulatorPointId::Anchor(p) = point_id { Some(*p) } else { None })
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
// Match the behavior of `PathOverlayMode::SelectedPointHandles` when only one point is selected
|
||||
if shape_editor.selected_points().count() == 1 {
|
||||
|
|
@ -802,6 +806,9 @@ impl Fsm for PathToolFsmState {
|
|||
for (point, attached_segments) in selected_segments_by_point {
|
||||
if attached_segments.len() == 1 {
|
||||
segment_endpoints.entry(attached_segments[0]).or_default().push(point);
|
||||
} else if !selected_anchors.contains(&point) {
|
||||
segment_endpoints.entry(attached_segments[0]).or_default().push(point);
|
||||
segment_endpoints.entry(attached_segments[1]).or_default().push(point);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1110,6 +1117,13 @@ impl Fsm for PathToolFsmState {
|
|||
PathToolFsmState::Ready
|
||||
}
|
||||
(PathToolFsmState::Dragging { .. }, PathToolMessage::Escape | PathToolMessage::RightClick) => {
|
||||
if tool_data.handle_drag_toggle && tool_data.drag_start_pos.distance(input.mouse.position) > DRAG_THRESHOLD {
|
||||
shape_editor.deselect_all_points();
|
||||
shape_editor.select_points_by_manipulator_id(&tool_data.saved_points_before_handle_drag);
|
||||
|
||||
tool_data.saved_points_before_handle_drag.clear();
|
||||
tool_data.handle_drag_toggle = false;
|
||||
}
|
||||
responses.add(DocumentMessage::AbortTransaction);
|
||||
tool_data.snap_manager.cleanup(responses);
|
||||
PathToolFsmState::Ready
|
||||
|
|
|
|||
|
|
@ -827,7 +827,14 @@ impl Fsm for PenToolFsmState {
|
|||
self
|
||||
}
|
||||
(PenToolFsmState::Ready, PenToolMessage::Overlays(mut overlay_context)) => {
|
||||
path_overlays(document, DrawHandles::All, shape_editor, &mut overlay_context);
|
||||
match tool_options.pen_overlay_mode {
|
||||
PenOverlayMode::AllHandles => {
|
||||
path_overlays(document, DrawHandles::All, shape_editor, &mut overlay_context);
|
||||
}
|
||||
PenOverlayMode::FrontierHandles => {
|
||||
path_overlays(document, DrawHandles::None, shape_editor, &mut overlay_context);
|
||||
}
|
||||
}
|
||||
tool_data.snap_manager.draw_overlays(SnapData::new(document, input), &mut overlay_context);
|
||||
self
|
||||
}
|
||||
|
|
@ -896,7 +903,14 @@ impl Fsm for PenToolFsmState {
|
|||
}
|
||||
} else {
|
||||
// Draw the whole path and its manipulators when the user is clicking-and-dragging out from the most recently placed anchor to set its outgoing handle, during which it would otherwise not have its overlays drawn
|
||||
path_overlays(document, DrawHandles::All, shape_editor, &mut overlay_context);
|
||||
match tool_options.pen_overlay_mode {
|
||||
PenOverlayMode::AllHandles => {
|
||||
path_overlays(document, DrawHandles::All, shape_editor, &mut overlay_context);
|
||||
}
|
||||
PenOverlayMode::FrontierHandles => {
|
||||
path_overlays(document, DrawHandles::None, shape_editor, &mut overlay_context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if self == PenToolFsmState::DraggingHandle(tool_data.handle_mode) && valid(next_anchor, next_handle_start) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue