public void StartDrag(EditorControl ec, EditorEvent e) { if (e.Event.button != 0) { return; } if (e.Event.control) { _mouseOffset = e.Event.mousePosition - NodePanels.LocalPosition - ec.LocalPosition; EditorControlDragEventManager.Instance.StartDragEvent(ec); e.Use(); _isChildDrag = NodeDragType.CtrlDrag; _dragingNode = ec; } else if (e.Event.shift) { _mouseOffset = e.Event.mousePosition - NodePanels.LocalPosition - ec.LocalPosition; EditorControlDragEventManager.Instance.StartDragEvent(ec); _isChildDrag = NodeDragType.ShiftDrag; _dragingNode = ec; e.Use(); } }
public void DropIn(EditorControl root1, EditorEvent e, IEditorSeletable node1) { BeTreeNode node = node1 as BeTreeNode; BeTreeNode root = root1 as BeTreeNode; if (node == null || root == null || node == root) { return; } switch (_isChildDrag) { case NodeDragType.CtrlDrag: NodeSetToChild?.Invoke(root, node); break; case NodeDragType.ShiftDrag: NodeInsert?.Invoke(root, node); break; } _isChildDrag = NodeDragType.None; _dragingNode = null; ReCalculateNode(); e.Use(); }