Change connect nodes behavor.

If hovered target is not editable, create new node instead of connect existed nodes.
master
Jeremy Hu 2018-09-02 07:48:38 +08:00
parent 6693365543
commit fe401a5f13
1 changed files with 3 additions and 3 deletions

View File

@ -1096,9 +1096,9 @@ bool SkeletonGraphicsWidget::mousePress(QMouseEvent *event)
if (m_addFromNodeItem) { if (m_addFromNodeItem) {
if (m_hoveredNodeItem && m_addFromNodeItem && if (m_hoveredNodeItem && m_addFromNodeItem &&
m_hoveredNodeItem != m_addFromNodeItem && m_hoveredNodeItem != m_addFromNodeItem &&
m_hoveredNodeItem->profile() == m_addFromNodeItem->profile()) { m_hoveredNodeItem->profile() == m_addFromNodeItem->profile() &&
if (m_document->findEdgeByNodes(m_addFromNodeItem->id(), m_hoveredNodeItem->id())) !m_document->findEdgeByNodes(m_addFromNodeItem->id(), m_hoveredNodeItem->id()) &&
return true; m_document->isNodeEditable(m_hoveredNodeItem->id())) {
emit addEdge(m_addFromNodeItem->id(), m_hoveredNodeItem->id()); emit addEdge(m_addFromNodeItem->id(), m_hoveredNodeItem->id());
emit groupOperationAdded(); emit groupOperationAdded();
return true; return true;