Changeset 2016
- Timestamp:
- 06/04/09 20:45:39 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Visualization/3.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization/3.2/LineChart.cs
r2015 r2016 654 654 ZoomListener zoomListener = new ZoomListener(e.Location); 655 655 zoomListener.DrawRectangle += DrawRectangle; 656 zoomListener. SetClippingArea += SetClippingArea;656 zoomListener.Zoom += Zoom; 657 657 658 658 rectangleShape.Rectangle = RectangleD.Empty; … … 728 728 } 729 729 730 private void SetClippingArea(Rectangle rectangle) {730 private void Zoom(Rectangle rectangle) { 731 731 RectangleD clippingArea = Transform.ToWorld(rectangle, xAxis.Viewport, xAxis.ClippingArea); 732 732 -
trunk/sources/HeuristicLab.Visualization/3.2/ZoomListener.cs
r1963 r2016 8 8 9 9 public event RectangleHandler DrawRectangle; 10 public event RectangleHandler SetClippingArea;10 public event RectangleHandler Zoom; 11 11 12 12 public ZoomListener(Point startPoint) { … … 23 23 24 24 public void MouseUp(object sender, MouseEventArgs e) { 25 if( SetClippingArea!= null) {26 SetClippingArea(CalcRectangle(e.Location));25 if(Zoom != null) { 26 Zoom(CalcRectangle(e.Location)); 27 27 } 28 28 } … … 38 38 return new Rectangle(x, y, width, height); 39 39 } 40 41 public static RectangleD ZoomClippingArea(RectangleD clippingArea, double zoomFactor) {42 double x1, x2, y1, y2, width, height;43 44 width = clippingArea.Width * zoomFactor;45 height = clippingArea.Height * zoomFactor;46 47 x1 = clippingArea.X1 - (width - clippingArea.Width) / 2;48 y1 = clippingArea.Y1 - (height - clippingArea.Height) / 2;49 x2 = width + x1;50 y2 = height + y1;51 52 return new RectangleD(x1, y1, x2, y2);53 }54 40 } 55 41 }
Note: See TracChangeset
for help on using the changeset viewer.