protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); if (!ready) { return; } if (dragging) { Capture = false; stopDrag = Vector.V(e.X, e.Y); dragging = false; double f1 = gridF.getAbsolutePos(startDrag.x); double f2 = gridF.getAbsolutePos(stopDrag.x); if (f1 > f2) { flip(ref f1, ref f2); } double y1 = gridY.getAbsolutePos(startDrag.y); double y2 = gridY.getAbsolutePos(stopDrag.y); if (y1 > y2) { flip(ref y1, ref y2); } gridF.newRange(f1, f2); // gridY.newRange(y1, y2); root.updateRanges(); Invalidate(); } }
protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); if (dragging) { Capture = false; stopDrag = Vector.V(e.X, e.Y); dragging = false; if (Math.Abs(startDrag.x - stopDrag.x) < 5) { return; } if (Math.Abs(startDrag.y - stopDrag.y) < 5) { return; } double x1 = x.getAbsolutePos(startDrag.x); double x2 = x.getAbsolutePos(stopDrag.x); if (x1 > x2) { flip(ref x1, ref x2); } x.newRange(x1, x2); if (selectedScreen == 0) { double u1 = y1.getAbsolutePos(startDrag.y); double u2 = y1.getAbsolutePos(stopDrag.y); if (u1 > u2) { flip(ref u1, ref u2); } y1.newRange(u1, u2); } else { double u1 = y2.getAbsolutePos(startDrag.y); double u2 = y2.getAbsolutePos(stopDrag.y); if (u1 > u2) { flip(ref u1, ref u2); } y2.newRange(u1, u2); } root.updateRanges(); Invalidate(); } }
public void updateYRange(double ymin, double ymax, bool isLog, bool isAutoScale) { if (isAutoScale) { autoscale = true; if (isLog) { yAxis.logScale = true; } else { yAxis.logScale = false; } } else { autoscale = false; if (isLog) { if (ymin <= 0) { ymin = 1e-12; } if (ymax <= ymin) { ymax = ymin * 100; } yAxis.newRange(ymin, ymax); yAxis.logScale = true; } else { yAxis.logScale = false; yAxis.newRange(ymin, ymax); } } }
public void updateTraceTime(int __tracelength, double __tracetime) { if (_traceLength != __tracelength) { if (traces != null) { for (int i = 0; i < traces.Length; i++) { traces[i].updateLen(__tracelength); } } xAxis.newRange(0, __tracetime); _traceLength = __tracelength; _traceTime = __tracetime; } }
protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); if (dragging) { Capture = false; stopDrag = Vector.V(e.X, e.Y); dragging = false; double x1 = gridX.getAbsolutePos(startDrag.x); double x2 = gridX.getAbsolutePos(stopDrag.x); if (x1 > x2) { flip(ref x1, ref x2); } gridX.newRange(x1, x2); // root.updateRanges(); Invalidate(); } }