示例#1
0
 public void OnDrag(UIDragEventArgs e)
 {
     if (CurDragType == DragType.Noodle)
     {
         //NoodleEnd.Pos = NodeToDrag.Pos + new Vector2L(150, 17) + (e.GetClientPos() - cursorStartPos) / ZoomHandler.Zoom;
         //TempNoodle.Refresh();
         Vector2L endPoint = NodeToDrag.OutputPos + (e.GetClientPos() - cursorStartPos) / ZoomHandler.Zoom;
         TempNoodle.SetEndPoint(endPoint);
     }
 }
示例#2
0
        public async Task OnStartCreateNodeDrag(INode nodeToDrag, UIDragEventArgs e)
        {
            NodeToDrag     = nodeToDrag;
            CurDragType    = DragType.Node;
            cursorStartPos = e.GetClientPos();
            var scaledPos = await jsRuntime.InvokeAsync <float[]>("panzoom.clientToGraphPos", e.ClientX, e.ClientY);

            int x = (int)scaledPos[0];
            int y = (int)scaledPos[1];

            NodeToDrag.Pos = new Vector2L(x - 75, y - 15);
        }
示例#3
0
 public void OnDrop(UIDragEventArgs e)
 {
     if (CurDragType == DragType.Node)
     {
         NodeToDrag?.MoveBy((e.GetClientPos() - cursorStartPos) / ZoomHandler.Zoom);
     }
     else if (CurDragType == DragType.Noodle)
     {
         //TempNoodle.Refresh();
     }
     TempNoodle.Enabled = false;
     TempNoodle.Valid   = false;
     NodeToDrag         = null;
     CurDragType        = DragType.None;
 }
示例#4
0
        public void OnStartNoodleDrag(INode nodeToDrag, UIDragEventArgs e)
        {
            CurDragType = DragType.Noodle;
            NodeToDrag  = nodeToDrag;
            //NoodleEnd.Pos = NodeToDrag.Pos + new Vector2L(150, 17);
            TempNoodle.SetStartPoint(nodeToDrag.OutputPos);
            TempNoodle.SetEndPoint(nodeToDrag.OutputPos);


            TempNoodle.Enabled = true;

            cursorStartPos = e.GetClientPos();
            Console.WriteLine("Start Noodle Drag");
            jsRuntime.InvokeAsync <object>("tempNoodle.startNoodleDrag");
            //TempNoodle.Refresh();
        }
示例#5
0
 public void OnStartNodeDrag(INode nodeToDrag, UIDragEventArgs e)
 {
     NodeToDrag     = nodeToDrag;
     CurDragType    = DragType.Node;
     cursorStartPos = e.GetClientPos();
 }