[ui] GraphEditor: Added check for node shake and connected shake to disconnect nodes method

This commit is contained in:
waaake 2025-01-12 17:52:11 +05:30 committed by Candice Bentéjac
parent 1fdf27022b
commit b07540eaac

View file

@ -856,6 +856,10 @@ Item {
onAttributePinCreated: function(attribute, pin) { registerAttributePin(attribute, pin) } onAttributePinCreated: function(attribute, pin) { registerAttributePin(attribute, pin) }
onAttributePinDeleted: function(attribute, pin) { unregisterAttributePin(attribute, pin) } onAttributePinDeleted: function(attribute, pin) { unregisterAttributePin(attribute, pin) }
onShaked: {
uigraph.disconnectSelectedNodes();
}
onPressed: function(mouse) { onPressed: function(mouse) {
nodeRepeater.updateSelectionOnClick = true; nodeRepeater.updateSelectionOnClick = true;
nodeRepeater.ongoingDrag = true; nodeRepeater.ongoingDrag = true;
@ -951,6 +955,9 @@ Item {
if(!selected || !dragging) { if(!selected || !dragging) {
return; return;
} }
// Check for shake on the node
checkForShake();
// Compute offset between the delegate and the stored node position. // Compute offset between the delegate and the stored node position.
const offset = Qt.point(x - node.x, y - node.y); const offset = Qt.point(x - node.x, y - node.y);