dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/System.Drawing.Xsharp DrawingPen.cs,


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System.Drawing.Xsharp DrawingPen.cs,1.2,1.3
Date: Fri, 20 Jun 2003 19:28:30 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/System.Drawing.Xsharp
In directory subversions:/tmp/cvs-serv6027/System.Drawing.Xsharp

Modified Files:
        DrawingPen.cs 
Log Message:


Implement some of the support code for dashed pens in Xsharp - not
100% working yet.


Index: DrawingPen.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Drawing.Xsharp/DrawingPen.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** DrawingPen.cs       12 Jun 2003 02:55:48 -0000      1.2
--- DrawingPen.cs       20 Jun 2003 23:28:28 -0000      1.3
***************
*** 44,56 ****
                                switch(style)
                                {
-                                       // TODO: dashed lines
                                        case DashStyle.Solid:
                                        case DashStyle.Dash:
                                        case DashStyle.Dot:
                                        case DashStyle.DashDot:
                                        case DashStyle.DashDotDot:
!                                       case DashStyle.Custom:
!                                       default:
!                                               return LineStyle.LineSolid;
                                }
                        }
--- 44,56 ----
                                switch(style)
                                {
                                        case DashStyle.Solid:
+                                       case DashStyle.Custom:
+                                       default:
+                                               return LineStyle.LineSolid;
                                        case DashStyle.Dash:
                                        case DashStyle.Dot:
                                        case DashStyle.DashDot:
                                        case DashStyle.DashDotDot:
!                                               return LineStyle.LineOnOffDash;
                                }
                        }
***************
*** 87,90 ****
--- 87,96 ----
                        }
  
+       // Standard dash patterns.
+       private static readonly byte[] dash = {3, 1};
+       private static readonly byte[] dot = {1, 1};
+       private static readonly byte[] dashdot = {3, 1, 1, 1};
+       private static readonly byte[] dashdotdot = {3, 1, 1, 1, 1, 1};
+ 
        // Select this pen into a graphics object.
        public void Select(IToolkitGraphics _graphics)
***************
*** 95,104 ****
                                        Xsharp.Graphics g = graphics.graphics;
                                        g.LineWidth = (int)(properties.Width);
!                                       g.LineStyle = 
MapLineStyle(properties.DashStyle);
                                        g.CapStyle = 
MapCapStyle(properties.EndCap);
                                        g.JoinStyle = 
MapJoinStyle(properties.LineJoin);
                                        g.Foreground = 
DrawingToolkit.DrawingToXColor
                                                (properties.Color);
-                                       // TODO: dashed line patterns
                                }
                        }
--- 101,139 ----
                                        Xsharp.Graphics g = graphics.graphics;
                                        g.LineWidth = (int)(properties.Width);
!                                       LineStyle style = 
MapLineStyle(properties.DashStyle);
!                                       if(style == LineStyle.LineOnOffDash)
!                                       {
!                                               switch(properties.DashStyle)
!                                               {
!                                                       case DashStyle.Dash:
!                                                       {
!                                                               g.DashPattern = 
dash;
!                                                       }
!                                                       break;
! 
!                                                       case DashStyle.Dot:
!                                                       {
!                                                               g.DashPattern = 
dot;
!                                                       }
!                                                       break;
! 
!                                                       case DashStyle.DashDot:
!                                                       {
!                                                               g.DashPattern = 
dashdot;
!                                                       }
!                                                       break;
! 
!                                                       case 
DashStyle.DashDotDot:
!                                                       {
!                                                               g.DashPattern = 
dashdotdot;
!                                                       }
!                                                       break;
!                                               }
!                                       }
!                                       g.LineStyle = style;
                                        g.CapStyle = 
MapCapStyle(properties.EndCap);
                                        g.JoinStyle = 
MapJoinStyle(properties.LineJoin);
                                        g.Foreground = 
DrawingToolkit.DrawingToXColor
                                                (properties.Color);
                                }
                        }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]