Author: spouliot
Date: 2007-08-30 08:49:07 -0400 (Thu, 30 Aug 2007)
New Revision: 85040

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

        * shape.cpp: Fix small rectangle fills when no stroke brush is 
        specified.



Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-08-30 12:24:53 UTC (rev 85039)
+++ trunk/moon/src/ChangeLog    2007-08-30 12:49:07 UTC (rev 85040)
@@ -1,3 +1,8 @@
+2007-08-30  Sebastien Pouliot  <[EMAIL PROTECTED]> 
+
+       * shape.cpp: Fix small rectangle fills when no stroke brush is 
+       specified.
+
 2007-08-29  Jeffrey Stedfast  <[EMAIL PROTECTED]>
 
        * text.cpp (OnPropertyChanged): Don't recalculate width/height nor

Modified: trunk/moon/src/shape.cpp
===================================================================
--- trunk/moon/src/shape.cpp    2007-08-30 12:24:53 UTC (rev 85039)
+++ trunk/moon/src/shape.cpp    2007-08-30 12:49:07 UTC (rev 85040)
@@ -187,12 +187,6 @@
        }
 }
 
-bool
-Shape::IsFilled ()
-{
-       return shape_get_fill (this) != NULL; 
-}
-
 //
 // This routine is useful for Shape derivatives: it can be used
 // to either get the bounding box from cairo, or to paint it
@@ -762,7 +756,7 @@
        }
 
        Stretch stretch = shape_get_stretch (this);
-       double t = shape_get_stroke_thickness (this);
+       double t = IsStroked () ? shape_get_stroke_thickness (this) : 0.0;
 
        // nothing is drawn (nor filled) if no StrokeThickness="0"
        // unless both Width and Height are specified or when no streching is 
required
@@ -855,7 +849,7 @@
                w = h = (w < h) ? w : h;
                break;
        case StretchUniformToFill:
-               // this gets an ellipse larger than it's dimension, relative
+               // this gets an rectangle larger than it's dimension, relative
                // scaling is ok but we need Shape::Draw to clip to it's 
original size
                w = h = (w > h) ? w : h;
                break;
@@ -865,7 +859,7 @@
                break;
        }
 
-       if ((t != 0.0) && compute_origin) {
+       if ((!IsStroked () || (t != 0.0)) && compute_origin) {
                x = t / 2.0;
                y = x - 0.5;
        }

Modified: trunk/moon/src/shape.h
===================================================================
--- trunk/moon/src/shape.h      2007-08-30 12:24:53 UTC (rev 85039)
+++ trunk/moon/src/shape.h      2007-08-30 12:49:07 UTC (rev 85040)
@@ -75,7 +75,8 @@
        // new virtual methods for shapes
        //
        
-       virtual bool IsFilled ();
+       virtual bool IsFilled () { return fill; }
+       virtual bool IsStroked () { return stroke; }
        virtual FillRule GetFillRule () { return FillRuleNonzero; }
 
        //

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

Reply via email to