add moving visject nodes in smaller increments when holding shift and alt

This commit is contained in:
Saas
2025-09-15 22:37:31 +02:00
parent 1de8909d05
commit 187592b673

View File

@@ -721,7 +721,12 @@ namespace FlaxEditor.Surface
if (HasNodesSelection)
{
var keyMoveRange = 50;
var keyMoveDelta = 50;
bool altDown = RootWindow.GetKey(KeyboardKeys.Alt);
bool shiftDown = RootWindow.GetKey(KeyboardKeys.Shift);
if (altDown || shiftDown)
keyMoveDelta = shiftDown ? 10 : 25;
switch (key)
{
case KeyboardKeys.Backspace:
@@ -759,7 +764,7 @@ namespace FlaxEditor.Surface
else if (!IsMovingSelection && CanEdit)
{
// Move selected nodes
var delta = new Float2(0, key == KeyboardKeys.ArrowUp ? -keyMoveRange : keyMoveRange);
var delta = new Float2(0, key == KeyboardKeys.ArrowUp ? -keyMoveDelta : keyMoveDelta);
MoveSelectedNodes(delta);
}
return true;
@@ -775,9 +780,8 @@ namespace FlaxEditor.Surface
if ((key == KeyboardKeys.ArrowRight && selectedBox.IsOutput) || (key == KeyboardKeys.ArrowLeft && !selectedBox.IsOutput))
{
if (_selectedConnectionIndex < 0 || _selectedConnectionIndex >= selectedBox.Connections.Count)
{
_selectedConnectionIndex = 0;
}
toSelect = selectedBox.Connections[_selectedConnectionIndex];
}
else
@@ -805,7 +809,7 @@ namespace FlaxEditor.Surface
else if (!IsMovingSelection && CanEdit)
{
// Move selected nodes
var delta = new Float2(key == KeyboardKeys.ArrowLeft ? -keyMoveRange : keyMoveRange, 0);
var delta = new Float2(key == KeyboardKeys.ArrowLeft ? -keyMoveDelta : keyMoveDelta, 0);
MoveSelectedNodes(delta);
}
return true;
@@ -821,13 +825,9 @@ namespace FlaxEditor.Surface
return true;
if (Root.GetKey(KeyboardKeys.Shift))
{
_selectedConnectionIndex = ((_selectedConnectionIndex - 1) % connectionCount + connectionCount) % connectionCount;
}
else
{
_selectedConnectionIndex = (_selectedConnectionIndex + 1) % connectionCount;
}
return true;
}
}