Changeset 13798
- Timestamp:
- 04/26/16 14:59:37 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/ChartModes/SelectChartMode.cs
r13762 r13798 20 20 #endregion 21 21 22 using System; 22 23 using System.Drawing; 23 24 using System.Linq; … … 52 53 try { 53 54 chartControl.SuspendRendering(); 54 var worldLocation = chartControl.Chart.TransformPixelToWorld(e.Location);55 foreach (var p in chartControl.Chart.Group.SelectedPrimitives.Where(x => !x.ContainsPoint(worldLocation)))55 var sp = chartControl.Chart.GetPrimitive(e.Location); 56 foreach (var p in chartControl.Chart.Group.SelectedPrimitives.Where(x => x != sp)) 56 57 p.Selected = false; 57 var sp = chartControl.Chart.GetPrimitive(e.Location);58 58 if (sp != null) sp.Selected = true; 59 OnSelectedPrimitivesChanged(); 59 60 } finally { chartControl.ResumeRendering(); } 60 61 break; … … 92 93 foreach (var p in chartControl.Chart.Group.SelectedPrimitives) 93 94 chartControl.Chart.Group.Remove(p); 95 OnSelectedPrimitivesChanged(); 94 96 } finally { chartControl.ResumeRendering(); } 97 } 98 99 public event EventHandler SelectedPrimitivesChanged; 100 protected virtual void OnSelectedPrimitivesChanged() { 101 var handler = SelectedPrimitivesChanged; 102 if (handler != null) handler(this, EventArgs.Empty); 95 103 } 96 104 }
Note: See TracChangeset
for help on using the changeset viewer.