Changeset 13114 for branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/ChartModes/ZoomInChartMode.cs
- Timestamp:
- 11/04/15 13:50:43 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/ChartModes/ZoomInChartMode.cs
r13108 r13114 38 38 39 39 public override void HandleOnMouseUp(object sender, MouseEventArgs e) { 40 base.HandleOnMouseUp(sender, e); 41 42 switch (e.Button) { 43 case MouseButtons.Left: 44 var lowerLeft = new Point(Math.Min(e.X, buttonDownPoint.X), Math.Max(e.Y, buttonDownPoint.Y)); 45 var upperRight = new Point(Math.Max(e.X, buttonDownPoint.X), Math.Min(e.Y, buttonDownPoint.Y)); 46 if ((lowerLeft.X != upperRight.X) && (lowerLeft.Y != upperRight.Y)) 47 chartControl.Chart.ZoomIn(lowerLeft, upperRight); 48 else chartControl.Chart.ZoomIn(buttonDownPoint); 49 break; 50 case MouseButtons.Middle: 51 chartControl.Chart.Unzoom(); 52 break; 40 try { 41 switch (e.Button) { 42 case MouseButtons.Left: 43 var lowerLeft = new Point(Math.Min(e.X, buttonDownPoint.X), Math.Max(e.Y, buttonDownPoint.Y)); 44 var upperRight = new Point(Math.Max(e.X, buttonDownPoint.X), Math.Min(e.Y, buttonDownPoint.Y)); 45 if ((lowerLeft.X != upperRight.X) && (lowerLeft.Y != upperRight.Y)) 46 chartControl.Chart.ZoomIn(lowerLeft, upperRight); 47 else chartControl.Chart.ZoomIn(buttonDownPoint); 48 break; 49 case MouseButtons.Middle: 50 chartControl.Chart.Unzoom(); 51 break; 52 } 53 } finally { 54 base.HandleOnMouseUp(sender, e); 53 55 } 54 56 } … … 58 60 switch (e.Button) { 59 61 case MouseButtons.Left: 60 chartControl. PictureBox.Refresh();61 using (var graphics = chartControl. PictureBox.CreateGraphics())62 chartControl.RefreshPicture(); 63 using (var graphics = chartControl.CreatePictureGraphics()) 62 64 using (var pen = new Pen(Color.Gray) { DashStyle = DashStyle.Dash }) { 63 65 graphics.DrawRectangle(pen, … … 70 72 } 71 73 } finally { 72 chartControl. PictureBox.Update();74 chartControl.UpdatePicture(); 73 75 base.HandleOnMouseMove(sender, e); 74 76 }
Note: See TracChangeset
for help on using the changeset viewer.