private void SetTime_Click(object sender, RoutedEventArgs e) { float prev = point.Previous?.Value.InVal ?? float.MinValue; float next = point.Next?.Value.InVal ?? float.MaxValue; string res = Microsoft.VisualBasic.Interaction.InputBox($"Enter time between {prev} and {next}", "Set Time", point.Value.InVal.ToString()); float result = 0; if (float.TryParse(res, out result) && result > prev && result < next) { X = graph.localX(result); graph.Paint(true); } }
public Anchor(CurveGraph g, LinkedListNode <CurvePoint> p) { graph = g; point = p; X = graph.localX(point.Value.InVal); Y = graph.localY(point.Value.OutVal); this.DragDelta += OnDragDelta; this.DragStarted += OnDragStarted; this.MouseDown += Anchor_MouseDown; leftHandle = new Handle(this, true); graph.graph.Children.Add(leftHandle); rightHandle = new Handle(this, false); graph.graph.Children.Add(rightHandle); leftBez = null; rightBez = null; }
public Anchor(CurveGraph g, LinkedListNode<CurvePoint> p) { graph = g; point = p; X = graph.localX(point.Value.InVal); Y = graph.localY(point.Value.OutVal); this.DragDelta += OnDragDelta; this.DragStarted += OnDragStarted; this.MouseDown += Anchor_MouseDown; leftHandle = new Handle(this, true); graph.graph.Children.Add(leftHandle); rightHandle = new Handle(this, false); graph.graph.Children.Add(rightHandle); leftBez = null; rightBez = null; }