nodeview: only remove dragged edge if arrow was dragged

This commit is contained in:
itsmattkc
2021-04-29 00:21:53 +10:00
parent 1fb7486daa
commit 502b5971f9
2 changed files with 8 additions and 1 deletions
+3 -1
View File
@@ -566,7 +566,9 @@ void NodeView::mouseReleaseEvent(QMouseEvent *event)
MultiUndoCommand* command = new MultiUndoCommand();
if (create_edge_already_exists_) {
command->add_child(new NodeEdgeRemoveCommand(create_edge_->output(), create_edge_->input()));
if (!create_edge_->IsConnected()) {
command->add_child(new NodeEdgeRemoveCommand(create_edge_->output(), create_edge_->input()));
}
} else {
delete create_edge_;
}
+5
View File
@@ -89,6 +89,11 @@ public:
*/
void SetConnected(bool c);
bool IsConnected() const
{
return connected_;
}
/**
* @brief Set highlighted state
*