Skip to content

Commit

Permalink
Merge branch 'master' into path-tool-update
Browse files Browse the repository at this point in the history
  • Loading branch information
bakayu authored Jan 20, 2025
2 parents d472eb5 + ad68b1e commit 23fac61
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions editor/src/messages/tool/tool_messages/pen_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,8 @@ impl PenToolData {
},
});
}
if close_subpath {
responses.add(DocumentMessage::EndTransaction);
} else {
responses.add(DocumentMessage::EndTransaction);
if !close_subpath {
self.add_point(LastPoint {
id: end,
pos: next_point,
Expand Down Expand Up @@ -764,7 +763,7 @@ impl Fsm for PenToolFsmState {

state
}
(PenToolFsmState::DraggingHandle | PenToolFsmState::PlacingAnchor, PenToolMessage::Abort | PenToolMessage::Confirm) => {
(PenToolFsmState::DraggingHandle | PenToolFsmState::PlacingAnchor, PenToolMessage::Confirm) => {
responses.add(DocumentMessage::EndTransaction);
tool_data.handle_end = None;
tool_data.latest_points.clear();
Expand Down Expand Up @@ -793,9 +792,8 @@ impl Fsm for PenToolFsmState {
}
(_, PenToolMessage::Redo) => {
tool_data.point_index = (tool_data.point_index + 1).min(tool_data.latest_points.len().saturating_sub(1));
tool_data
.place_anchor(SnapData::new(document, input), transform, input.mouse.position, responses)
.unwrap_or(PenToolFsmState::PlacingAnchor)
tool_data.place_anchor(SnapData::new(document, input), transform, input.mouse.position, responses);
(tool_data.point_index == 0).then_some(PenToolFsmState::Ready).unwrap_or(PenToolFsmState::PlacingAnchor)
}
_ => self,
}
Expand Down

0 comments on commit 23fac61

Please sign in to comment.