This commit is contained in:
Lixívia 2025-07-07 10:21:48 +02:00 committed by GitHub
commit 75d04c442f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -430,7 +430,14 @@ impl Fsm for SplineToolFsmState {
SplineToolFsmState::MergingEndpoints
}
(SplineToolFsmState::Drawing, SplineToolMessage::Abort) => {
responses.add(DocumentMessage::AbortTransaction);
if tool_data.points.len() < 2 {
// Delete layer if it is only a single point
responses.add(DocumentMessage::AbortTransaction);
} else {
// Delete the preview of the next stroke but commit the path
delete_preview(tool_data, responses);
responses.add(DocumentMessage::EndTransaction);
}
SplineToolFsmState::Ready
}
(_, SplineToolMessage::WorkingColorChanged) => {