mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-07-08 00:05:00 +00:00
Fix issue when extending existing paths Co-authored-by: Starklosch <45690579+Starklosch@users.noreply.github.com>
This commit is contained in:
parent
c486c6e3e3
commit
a6d3c06641
1 changed files with 8 additions and 2 deletions
|
@ -316,6 +316,7 @@ struct PenToolData {
|
|||
|
||||
snap_cache: SnapCache,
|
||||
}
|
||||
|
||||
impl PenToolData {
|
||||
fn latest_point(&self) -> Option<&LastPoint> {
|
||||
self.latest_points.get(self.point_index)
|
||||
|
@ -1601,7 +1602,12 @@ impl Fsm for PenToolFsmState {
|
|||
PenToolFsmState::Ready
|
||||
}
|
||||
(_, PenToolMessage::Abort) => {
|
||||
let should_delete_layer = tool_data.latest_points.len() == 1;
|
||||
let should_delete_layer = if layer.is_some() {
|
||||
let vector_data = document.network_interface.compute_modified_vector(layer.unwrap()).unwrap();
|
||||
vector_data.point_domain.ids().len() == 1
|
||||
} else {
|
||||
false
|
||||
};
|
||||
|
||||
responses.add(DocumentMessage::AbortTransaction);
|
||||
tool_data.handle_end = None;
|
||||
|
@ -1610,7 +1616,7 @@ impl Fsm for PenToolFsmState {
|
|||
tool_data.draw_mode = DrawMode::BreakPath;
|
||||
tool_data.snap_manager.cleanup(responses);
|
||||
|
||||
if should_delete_layer && layer.is_some() {
|
||||
if should_delete_layer {
|
||||
responses.add(NodeGraphMessage::DeleteNodes {
|
||||
node_ids: vec![layer.unwrap().to_node()],
|
||||
delete_children: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue