Skip to content

Commit c95ee31

Browse files
committed
Fixed Drop On wire, from this fork: pedroCabrera@fe1418e
1 parent 1bfce6b commit c95ee31

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

PyFlow/UI/Widgets/BlueprintCanvas.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,7 +1402,7 @@ def dragMoveEvent(self, event):
14021402
event.setDropAction(QtCore.Qt.MoveAction)
14031403
event.accept()
14041404
if self.tempnode:
1405-
self.tempnode.setPos((self.tempnode.w / -2) + scenePos.x(), scenePos.y())
1405+
self.tempnode.setPos((self.tempnode.w / -2) + scenePos.x()+5, scenePos.y()+5)
14061406
mouseRect = QtCore.QRect(QtCore.QPoint(scenePos.x() - 1, scenePos.y() - 1),
14071407
QtCore.QPoint(scenePos.x() + 1, scenePos.y() + 1))
14081408
hoverItems = self.scene().items(mouseRect)
@@ -1484,7 +1484,19 @@ def varSetterCreator():
14841484
libName = jsonData['lib']
14851485
name = nodeType
14861486
dropItem = self.nodeFromInstance(self.itemAt(scenePos.toPoint()))
1487-
if not dropItem or (isinstance(dropItem, UINodeBase) and dropItem.isCommentNode or dropItem.isTemp) or isinstance(dropItem, UIPinBase) or isinstance(dropItem, UIConnection):
1487+
#if not dropItem or (isinstance(dropItem, UINodeBase) and dropItem.isCommentNode or dropItem.isTemp) or isinstance(dropItem, UIPinBase) or isinstance(dropItem, UIConnection):
1488+
#######################################################
1489+
# Drop from nodebox by R. Scharf-Wildenhain, 2022-07-22
1490+
# dropItem = self.nodeFromInstance(self.itemAt(scenePos.toPoint()))
1491+
dropNode = self.nodeFromInstance(self.itemAt(event.pos()))
1492+
dropItem = self.itemAt(event.pos())
1493+
1494+
# if not dropItem or (isinstance(dropItem, UINodeBase) and dropItem.isCommentNode or dropItem.isTemp) or isinstance(dropItem, UIPinBase) or isinstance(dropItem, UIConnection):
1495+
if dropNode or not dropNode or \
1496+
(isinstance(dropItem, UINodeBase) and (dropItem.isCommentNode or dropItem.isTemp)) or \
1497+
isinstance(dropItem, UIPinBase) or \
1498+
isinstance(dropItem, UIConnection):
1499+
#######################################################
14881500
nodeTemplate = NodeBase.jsonTemplate()
14891501
nodeTemplate['package'] = packageName
14901502
nodeTemplate['lib'] = libName

0 commit comments

Comments
 (0)