Exemplo n.º 1
0
        private static void HandleNodeDragging(NodeEditorInputInfo inputInfo)
        {
            NodeEditorState state = inputInfo.editorState;

            if (state.dragNode)
            {
                if (state.selectedNode != null && GUIUtility.hotControl == 0)
                {
                    state.dragOffset = inputInfo.inputPos - state.dragStart;
                    state.selectedNode.rect.position = state.dragPos + state.dragOffset * state.zoom;
                    NodeEditorCallbacks.IssueOnMoveNode(state.selectedNode);
                    NodeEditor.RepaintClients();
                }
                else
                {
                    state.dragNode = false;
                }
            }
        }