From fe401a5f13b75c9f4f9bdb8b09e20c154be3afb8 Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Sun, 2 Sep 2018 07:48:38 +0800 Subject: [PATCH] Change connect nodes behavor. If hovered target is not editable, create new node instead of connect existed nodes. --- src/skeletongraphicswidget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/skeletongraphicswidget.cpp b/src/skeletongraphicswidget.cpp index b5d831d8..f9b6d94a 100644 --- a/src/skeletongraphicswidget.cpp +++ b/src/skeletongraphicswidget.cpp @@ -1096,9 +1096,9 @@ bool SkeletonGraphicsWidget::mousePress(QMouseEvent *event) if (m_addFromNodeItem) { if (m_hoveredNodeItem && m_addFromNodeItem && m_hoveredNodeItem != m_addFromNodeItem && - m_hoveredNodeItem->profile() == m_addFromNodeItem->profile()) { - if (m_document->findEdgeByNodes(m_addFromNodeItem->id(), m_hoveredNodeItem->id())) - return true; + m_hoveredNodeItem->profile() == m_addFromNodeItem->profile() && + !m_document->findEdgeByNodes(m_addFromNodeItem->id(), m_hoveredNodeItem->id()) && + m_document->isNodeEditable(m_hoveredNodeItem->id())) { emit addEdge(m_addFromNodeItem->id(), m_hoveredNodeItem->id()); emit groupOperationAdded(); return true;