Author: spouliot
Date: 2007-06-08 11:40:34 -0400 (Fri, 08 Jun 2007)
New Revision: 78961

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/shape.cpp
   trunk/moon/src/shape.h
Log:
2007-06-08  Sebastien Pouliot  <[EMAIL PROTECTED]> 

        * shape.h: Don't waste time trying to fill lines.
        * shape.cpp: Fix dashes support. First reset between shapes and, 
        second, handle cairo dislike of a single dash value of 0.0.



Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-06-08 14:54:23 UTC (rev 78960)
+++ trunk/moon/src/ChangeLog    2007-06-08 15:40:34 UTC (rev 78961)
@@ -1,3 +1,9 @@
+2007-06-08  Sebastien Pouliot  <[EMAIL PROTECTED]> 
+
+       * shape.h: Don't waste time trying to fill lines.
+       * shape.cpp: Fix dashes support. First reset between shapes and, 
+       second, handle cairo dislike of a single dash value of 0.0.
+
 2007-06-08  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * shape.cpp|h: Some shapes, like polylines, don't supports Fill.

Modified: trunk/moon/src/shape.cpp
===================================================================
--- trunk/moon/src/shape.cpp    2007-06-08 14:54:23 UTC (rev 78960)
+++ trunk/moon/src/shape.cpp    2007-06-08 15:40:34 UTC (rev 78961)
@@ -157,11 +157,16 @@
                cairo_set_line_width (s->cairo, shape_get_stroke_thickness 
(this));
 
                int count = 0;
+               double offset = 0.0;
                double *dashes = shape_get_stroke_dash_array (this, &count);
                if (dashes && (count > 0)) {
-                       double offset = shape_get_stroke_dash_offset (this);
-                       cairo_set_dash (s->cairo, dashes, count, offset);
+                       offset = shape_get_stroke_dash_offset (this);
+                       // special case or cairo stops drawing
+                       if ((count == 1) && (*dashes == 0.0))
+                               count = 0;
                }
+               cairo_set_dash (s->cairo, dashes, count, offset);
+
                cairo_set_miter_limit (s->cairo, shape_get_stroke_miter_limit 
(this));
                cairo_set_line_join (s->cairo, convert_line_join 
(shape_get_stroke_line_join (this)));
                /* FIXME: cairo doesn't have separate line cap for the start 
and end */

Modified: trunk/moon/src/shape.h
===================================================================
--- trunk/moon/src/shape.h      2007-06-08 14:54:23 UTC (rev 78960)
+++ trunk/moon/src/shape.h      2007-06-08 15:40:34 UTC (rev 78961)
@@ -136,6 +136,8 @@
        void Draw (Surface *s);
 
        virtual Point getxformorigin ();
+
+       virtual bool CanFill () { return false; }
 };
 Line *line_new  ();
 double line_get_x1 (Line *line);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to