Changeset 980 for trunk/sources/HeuristicLab.Visualization/LineShape.cs
- Timestamp:
- 12/12/08 07:15:24 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization/LineShape.cs
r870 r980 1 1 using System.Drawing; 2 using System.Drawing.Drawing2D; 2 3 3 4 namespace HeuristicLab.Visualization { … … 7 8 private Color color; 8 9 private int thickness; 10 private DashStyle dashStyle; 9 11 10 12 /// <summary> … … 16 18 /// <param name="y2">y coordinate of right lineEndPoind</param> 17 19 /// <param name="color">color for the LineShape</param> 18 public LineShape(double x1, double y1, double x2, double y2, double z, Color color, int thickness ) {20 public LineShape(double x1, double y1, double x2, double y2, double z, Color color, int thickness, DrawingStyle style) { 19 21 this.boundingBox = new RectangleD(x1, y1, x2, y2); 20 22 this.z = z; 21 23 this.color = color; 22 24 this.thickness = thickness; 25 if (style==DrawingStyle.Dashed) { 26 this.dashStyle = DashStyle.Dash; 27 } 28 else { 29 this.dashStyle = DashStyle.Solid; //default 30 } 23 31 } 24 32 … … 55 63 public void Draw(Graphics graphics, Rectangle viewport, RectangleD clippingArea) { 56 64 using (Pen pen = new Pen(color, thickness)){ 57 // TODO there seems to be a bug with drawing straight lines.65 pen.DashStyle = this.dashStyle; 58 66 Rectangle screenRect = Transform.ToScreen(boundingBox, viewport, clippingArea); 59 67 graphics.DrawLine(pen,screenRect.Left, screenRect.Bottom, screenRect.Right, screenRect.Top);
Note: See TracChangeset
for help on using the changeset viewer.