浏览代码

Even better node repositioning

/main
Peter Bay Bastian 7 年前
当前提交
53517148
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/GraphEditorView.cs

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/GraphEditorView.cs


var nodeView = port.node as MaterialNodeView;
if (nodeView == null)
return;
var offset = port.connectorBox.parent.ChangeCoordinatesTo(nodeView.mainContainer, port.connectorBox.layout.center);
var offset = nodeView.mainContainer.WorldToLocal(port.GetGlobalCenter() + new Vector3(3f, 3f, 0f));
var position = nodeView.GetPosition();
position.position -= offset;
nodeView.SetPosition(position);

正在加载...
取消
保存