Changeset 1963 for trunk/sources/HeuristicLab.Visualization
- Timestamp:
- 05/30/09 01:51:42 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization/3.2/ZoomListener.cs
r1530 r1963 1 using System; 1 2 using System.Drawing; 2 3 using System.Windows.Forms; … … 30 31 31 32 private Rectangle CalcRectangle(Point actualPoint) { 32 Rectangle rectangle = new Rectangle(); 33 34 if (startPoint.X < actualPoint.X) { 35 rectangle.X = startPoint.X; 36 rectangle.Width = actualPoint.X - startPoint.X; 37 } else { 38 rectangle.X = actualPoint.X; 39 rectangle.Width = startPoint.X - actualPoint.X; 40 } 41 42 if (startPoint.Y < actualPoint.Y) { 43 rectangle.Y = startPoint.Y; 44 rectangle.Height = actualPoint.Y - startPoint.Y; 45 } else { 46 rectangle.Y = actualPoint.Y; 47 rectangle.Height = startPoint.Y - actualPoint.Y; 48 } 49 50 return rectangle; 33 int x = Math.Min(startPoint.X, actualPoint.X); 34 int y = Math.Min(startPoint.Y, actualPoint.Y); 35 int width = Math.Abs(actualPoint.X - startPoint.X); 36 int height = Math.Abs(actualPoint.Y - startPoint.Y); 37 38 return new Rectangle(x, y, width, height); 51 39 } 52 40
Note: See TracChangeset
for help on using the changeset viewer.