Skip to content

Commit e3539a3

Browse files
committed
Fixed can't link to PassThrough output
1 parent 542e86a commit e3539a3

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

UI/PinItem.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,18 @@ void PinItem::mouseReleaseEvent(QGraphicsSceneMouseEvent* _event)
185185
if(m_dragging)
186186
{
187187
qDebug() << "Pin Release!";
188-
189188
QList<QGraphicsItem*> items = scene()->items(_event->scenePos());
190189

191-
PinItem* pin = nullptr;
192-
for(int i = 0; i < items.size() && pin == nullptr; i++)
193-
{
194-
pin = dynamic_cast<PinItem*>(items[i]);
195-
}
196-
197-
if(link(pin))
190+
bool found = false;
191+
for(int i = 0; !found && i < items.size(); ++i)
198192
{
199-
qDebug() << "Pin connected!";
200-
pin->update();
193+
PinItem* pin = dynamic_cast<PinItem*>(items[i]);
194+
if(link(pin))
195+
{
196+
qDebug() << "Pin connected!";
197+
pin->update();
198+
found = true;
199+
}
201200
}
202201

203202
m_dragging = false;

0 commit comments

Comments
 (0)