Author: lewing
Date: 2007-10-08 21:18:05 -0400 (Mon, 08 Oct 2007)
New Revision: 87141

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/media.cpp
   trunk/moon/src/panel.cpp
   trunk/moon/src/shape.cpp
Log:
2007-10-08 Larry Ewing <[EMAIL PROTECTED]>

        * media.cpp:
        * panel.cpp: intersect the bounds with the clip path to
        optimize the invalidated region.

        * shape.cpp: return 0.0 when shape_get_stroke_thickness is called
        with a NULL.


Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-10-09 00:12:58 UTC (rev 87140)
+++ trunk/moon/src/ChangeLog    2007-10-09 01:18:05 UTC (rev 87141)
@@ -30,6 +30,15 @@
 
 2007-10-08  Larry Ewing  <[EMAIL PROTECTED]>
 
+       * media.cpp:
+       * panel.cpp: intersect the bounds with the clip path to
+       optimize the invalidated region.
+
+       * shape.cpp: return 0.0 when shape_get_stroke_thickness is called
+       with a NULL.
+
+2007-10-08  Larry Ewing  <[EMAIL PROTECTED]>
+
        * runtime.cpp: change previous logic to drop the alpha
        completely here until more testing can be done.
 

Modified: trunk/moon/src/media.cpp
===================================================================
--- trunk/moon/src/media.cpp    2007-10-09 00:12:58 UTC (rev 87140)
+++ trunk/moon/src/media.cpp    2007-10-09 01:18:05 UTC (rev 87141)
@@ -313,13 +313,20 @@
 {
        double h = framework_element_get_height (this);
        double w = framework_element_get_width (this);
-       
        if (w == 0.0 && h == 0.0) {
                h = (double) mplayer->height;
                w = (double) mplayer->width;
        }
+
+       Rect box = Rect (0, 0, w, h);
        
-       bounds = bounding_rect_for_transformed_rect (&absolute_xform, Rect (0, 
0, w, h));
+       Value *value = GetValue (UIElement::ClipProperty);
+       if (value) {
+               Geometry *geometry = value->AsGeometry ();
+               box = box.Intersection (geometry->ComputeBounds (NULL));
+       }
+       
+       bounds = bounding_rect_for_transformed_rect (&absolute_xform, box);
 }
 
 Point
@@ -1353,11 +1360,18 @@
 void
 Image::ComputeBounds ()
 {
+       Rect box = Rect (0,0,
+                        framework_element_get_width (this),
+                        framework_element_get_height (this));
+       
+       Value *value = GetValue (UIElement::ClipProperty);
+       if (value) {
+               Geometry *geometry = value->AsGeometry ();
+               box = box.Intersection (geometry->ComputeBounds (NULL));
+       }
+                                                          
        bounds = bounding_rect_for_transformed_rect (&absolute_xform,
-                                                    Rect (0,0,
-                                                          
framework_element_get_width (this),
-                                                          
framework_element_get_height (this)));
-
+                                                    box);
 // no-op       bounds.GrowBy (1);
 }
 

Modified: trunk/moon/src/panel.cpp
===================================================================
--- trunk/moon/src/panel.cpp    2007-10-09 00:12:58 UTC (rev 87140)
+++ trunk/moon/src/panel.cpp    2007-10-09 01:18:05 UTC (rev 87141)
@@ -139,6 +139,16 @@
                        bounds = bounds.Union (fw_rect);
        }
 
+       Value *value = GetValue (UIElement::ClipProperty);
+       if (value) {
+               Geometry *geometry = value->AsGeometry ();
+               Rect box = geometry->ComputeBounds (NULL);
+               box = bounding_rect_for_transformed_rect (&absolute_xform,
+                                                         box);
+               bounds = box.Intersection (bounds);
+       }
+
+
        /* standard "grow the rectangle by enough to cover our
           asses because of cairo's floating point rendering"
           thing */

Modified: trunk/moon/src/shape.cpp
===================================================================
--- trunk/moon/src/shape.cpp    2007-10-09 00:12:58 UTC (rev 87140)
+++ trunk/moon/src/shape.cpp    2007-10-09 01:18:05 UTC (rev 87141)
@@ -513,6 +513,9 @@
 double
 shape_get_stroke_thickness (Shape *shape)
 {
+       if (!shape)
+               return 0.0;
+
        return shape->GetValue (Shape::StrokeThicknessProperty)->AsDouble();
 }
 

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

Reply via email to