public DataPoint OnMouseMove(MouseActionArgs args) { if (Deselected) { return(null); } LongPoint p = LongPoint.DeTranslateFromScreen(new LongPoint(args.Point), args.XRange, args.YRange, new LongRectangle(args.Rectangle)); return(ClosestPointTo(p)); }
internal void OnEventsMouseClick(MouseActionArgs args) { foreach (DataEvent e in DataEvents) { LongPoint pt = LongPoint.TranslateToScreen(e.Point, args.XRange, args.YRange, new LongRectangle(args.Rectangle)); if (pt.X - 8 <= args.Point.X && args.Point.X <= pt.X + 8) { SelectedItem = e; return; } } SelectedItem = null; }
public bool OnMouseClick(MouseActionArgs args) { DataRange yrange = this.CustomYRange ?? args.YRange; List <DataPoint> range = BinaryChop(Points, args.XRange); if (range.Count == 0) { return(false); } List <LongPoint> polypoints = new List <LongPoint>(); foreach (DataPoint p in range) { LongPoint lp = LongPoint.TranslateToScreen(p.Point, args.XRange, yrange, new LongRectangle(args.Rectangle)); polypoints.Add(new LongPoint(lp.X, lp.Y + 10)); polypoints.Insert(0, new LongPoint(lp.X, lp.Y - 10)); } Polygon poly = new Polygon(polypoints); return(poly.Contains(new LongPoint(args.Point))); }
internal void OnEventsMouseClick(MouseActionArgs args) { foreach(DataEvent e in DataEvents) { LongPoint pt = LongPoint.TranslateToScreen(e.Point, args.XRange, args.YRange, new LongRectangle(args.Rectangle)); if(pt.X - 8 <= args.Point.X && args.Point.X <= pt.X + 8) { SelectedItem = e; return; } } SelectedItem = null; }