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); } }
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); }
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; }
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(); }
public void OnStartNodeDrag(INode nodeToDrag, UIDragEventArgs e) { NodeToDrag = nodeToDrag; CurDragType = DragType.Node; cursorStartPos = e.GetClientPos(); }