mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 09:16:01 +08:00
Fixed formatting
This commit is contained in:
parent
0f5539e077
commit
2dfe6d3a91
@ -22,12 +22,11 @@ namespace XNodeEditor {
|
|||||||
[NonSerialized] private List<Vector2> draggedOutputReroutes = new List<Vector2>();
|
[NonSerialized] private List<Vector2> draggedOutputReroutes = new List<Vector2>();
|
||||||
private RerouteReference hoveredReroute = new RerouteReference();
|
private RerouteReference hoveredReroute = new RerouteReference();
|
||||||
private List<RerouteReference> selectedReroutes = new List<RerouteReference>();
|
private List<RerouteReference> selectedReroutes = new List<RerouteReference>();
|
||||||
private Rect nodeRects; // Is this used?
|
|
||||||
private Vector2 dragBoxStart;
|
private Vector2 dragBoxStart;
|
||||||
private UnityEngine.Object[] preBoxSelection;
|
private UnityEngine.Object[] preBoxSelection;
|
||||||
private RerouteReference[] preBoxSelectionReroute;
|
private RerouteReference[] preBoxSelectionReroute;
|
||||||
private Rect selectionBox;
|
private Rect selectionBox;
|
||||||
private bool isDoubleClick = false;
|
private bool isDoubleClick = false;
|
||||||
|
|
||||||
private struct RerouteReference {
|
private struct RerouteReference {
|
||||||
public XNode.NodePort port;
|
public XNode.NodePort port;
|
||||||
@ -175,7 +174,7 @@ namespace XNodeEditor {
|
|||||||
} else if (e.control || e.shift) DeselectNode(hoveredNode);
|
} else if (e.control || e.shift) DeselectNode(hoveredNode);
|
||||||
|
|
||||||
// Cache double click state, but only act on it in MouseUp - Except ClickCount only works in mouseDown.
|
// Cache double click state, but only act on it in MouseUp - Except ClickCount only works in mouseDown.
|
||||||
isDoubleClick = ( e.clickCount == 2 );
|
isDoubleClick = (e.clickCount == 2);
|
||||||
|
|
||||||
e.Use();
|
e.Use();
|
||||||
currentActivity = NodeActivity.HoldNode;
|
currentActivity = NodeActivity.HoldNode;
|
||||||
@ -246,9 +245,8 @@ namespace XNodeEditor {
|
|||||||
SelectNode(hoveredNode, false);
|
SelectNode(hoveredNode, false);
|
||||||
|
|
||||||
// Double click to center node
|
// Double click to center node
|
||||||
if ( isDoubleClick )
|
if (isDoubleClick) {
|
||||||
{
|
Vector2 nodeDimension = nodeSizes.ContainsKey(hoveredNode) ? nodeSizes[hoveredNode] / 2 : Vector2.zero;
|
||||||
Vector2 nodeDimension = nodeSizes.ContainsKey( hoveredNode ) ? nodeSizes[ hoveredNode ] / 2 : new Vector2(0f, 0f);
|
|
||||||
panOffset = -hoveredNode.position - nodeDimension;
|
panOffset = -hoveredNode.position - nodeDimension;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user