Skip to content

Commit 11e206c

Browse files
committed
Merge branch 'dev-dynamic-update-pin'
2 parents e72ecf9 + 707a4c1 commit 11e206c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/Node.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,15 @@ Node::onPortsUpdated()
226226
{
227227
const auto nNewIn = _nodeDataModel->nPorts(PortType::In);
228228
_nodeGeometry._nSources = nNewIn;
229-
_nodeState._inConnections.resize(nNewIn);
229+
_nodeState._inConnections.resize(nNewIn);
230230

231-
const auto nNewOut = _nodeDataModel->nPorts(PortType::Out);
231+
const auto nNewOut = _nodeDataModel->nPorts(PortType::Out);
232232
_nodeGeometry._nSinks = nNewOut;
233233
_nodeState._outConnections.resize(nNewOut);
234234

235235
//Recalculate the nodes visuals. A data change can result in the node taking more space than before, so this forces a recalculate+repaint on the affected node
236236
_nodeGraphicsObject->setGeometryChanged();
237+
_nodeGraphicsObject->moveConnections();
237238
_nodeGeometry.recalculateSize();
238239
_nodeGraphicsObject->update();
239240
recalculateVisuals();

src/NodeState.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ eraseConnection(PortType portType,
7272
PortIndex portIndex,
7373
QUuid id)
7474
{
75-
getEntries(portType)[portIndex].erase(id);
75+
auto& entires = getEntries(portType);
76+
77+
if (portIndex < entires.size())
78+
entires.at(portIndex).erase(id);
79+
7680
}
7781

7882

0 commit comments

Comments
 (0)