Author: rolf
Date: 2007-08-28 09:08:36 -0400 (Tue, 28 Aug 2007)
New Revision: 84949
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/geometry.h
trunk/moon/src/panel.cpp
trunk/moon/src/shape.cpp
trunk/moon/src/shape.h
trunk/moon/src/uielement.cpp
Log:
* panel.cpp: InsideObject: The point is only inside us if we have a
background, otherwise we act like if we were transparent (which is
what we are if we aren't painting anything inside us).
* geometry.h, uielement.cpp, shape.h: Rename CanFill to IsFilled so
that it's closer to what it actually does.
* shape.cpp: Changed implementation of Shape::CanFill to return true
only if we're actually filled, and rename CanFill to IsFilled so
that it's closer to what it actually does.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-08-28 12:48:36 UTC (rev 84948)
+++ trunk/moon/src/ChangeLog 2007-08-28 13:08:36 UTC (rev 84949)
@@ -1,3 +1,14 @@
+2007-08-28 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
+
+ * panel.cpp: InsideObject: The point is only inside us if we have a
+ background, otherwise we act like if we were transparent (which is
what
+ we are if we aren't painting anything inside us).
+ * geometry.h, uielement.cpp, shape.h: Rename CanFill to IsFilled so that
+ it's closer to what it actually does.
+ * shape.cpp: Changed implementation of Shape::CanFill to return true
only if
+ we're actually filled, and rename CanFill to IsFilled so that it's
+ closer to what it actually does.
+
2007-08-27 Jackson Harper <[EMAIL PROTECTED]>
* dependencyobject.cpp|h: Don't return Collections when getting
Modified: trunk/moon/src/geometry.h
===================================================================
--- trunk/moon/src/geometry.h 2007-08-28 12:48:36 UTC (rev 84948)
+++ trunk/moon/src/geometry.h 2007-08-28 13:08:36 UTC (rev 84949)
@@ -35,7 +35,7 @@
virtual void Draw (cairo_t *cr);
- virtual bool CanFill () { return true; };
+ virtual bool IsFilled () { return true; };
};
FillRule geometry_get_fill_rule (Geometry *geometry);
void geometry_set_fill_rule (Geometry *geometry, FillRule fill_rule);
@@ -142,7 +142,7 @@
virtual void Draw (cairo_t *cr);
// this is an element-by-element decision
- virtual bool CanFill () { return true; }
+ virtual bool IsFilled () { return true; }
};
PathGeometry *path_geometry_new ();
PathFigureCollection *path_geometry_get_figures (PathFigureCollection
*path_geometry);
Modified: trunk/moon/src/panel.cpp
===================================================================
--- trunk/moon/src/panel.cpp 2007-08-28 12:48:36 UTC (rev 84948)
+++ trunk/moon/src/panel.cpp 2007-08-28 13:08:36 UTC (rev 84949)
@@ -306,7 +306,10 @@
{
/* if we have explicitly set width/height, we check them */
if (FrameworkElement::InsideObject (cr, x, y)) {
- return true;
+ /* we're inside, check if we're actually painting any
background,
+ or, we're just transparent due to no painting. */
+ if (panel_get_background (this) != NULL)
+ return true;
}
bool is_inside_clip = InsideClip (cr, x, y);
Modified: trunk/moon/src/shape.cpp
===================================================================
--- trunk/moon/src/shape.cpp 2007-08-28 12:48:36 UTC (rev 84948)
+++ trunk/moon/src/shape.cpp 2007-08-28 13:08:36 UTC (rev 84949)
@@ -169,6 +169,12 @@
}
}
+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
@@ -190,7 +196,7 @@
// getting bounds, using cairo_stroke_extents, doesn't requires us to
fill (consider_fill)
// unless there is no stroke brush assigned, which requires us to fill
and use cairo_fill_extents
// also not every shapes can be filled, e.g. polylines, CallFill
- if ((consider_fill || !stroke) && CanFill ()) {
+ if ((consider_fill || !stroke) && IsFilled ()) {
if (fill) {
Draw (cr);
drawn = true;
@@ -307,7 +313,7 @@
cairo_matrix_transform_point (&inverse, &nx, &ny);
- if (cairo_in_stroke (cr, nx, ny) || (CanFill () && cairo_in_fill (cr,
nx, ny)))
+ if (cairo_in_stroke (cr, nx, ny) || (IsFilled () && cairo_in_fill (cr,
nx, ny)))
ret = TRUE;
cairo_new_path (cr);
@@ -1148,10 +1154,10 @@
}
bool
-Path::CanFill ()
+Path::IsFilled ()
{
Geometry* data = path_get_data (this);
- return (data ? data->CanFill () : false);
+ return (data ? data->IsFilled () : false);
}
void
Modified: trunk/moon/src/shape.h
===================================================================
--- trunk/moon/src/shape.h 2007-08-28 12:48:36 UTC (rev 84948)
+++ trunk/moon/src/shape.h 2007-08-28 13:08:36 UTC (rev 84949)
@@ -69,7 +69,7 @@
// new virtual methods for shapes
//
- virtual bool CanFill () { return true; }
+ virtual bool IsFilled ();
//
// Draw: draws the Shape in the cairo context (affine transforms are
set before this
@@ -163,7 +163,7 @@
// Line has no center to compute, it's always 0,0 because it provides
it's own start and end
// virtual Point GetTransformOrigin ();
- virtual bool CanFill () { return false; }
+ virtual bool IsFilled () { return false; }
virtual void OnPropertyChanged (DependencyProperty *prop);
};
@@ -252,7 +252,7 @@
void Draw (cairo_t *cr);
- virtual bool CanFill ();
+ virtual bool IsFilled ();
virtual void OnPropertyChanged (DependencyProperty *prop);
virtual void OnSubPropertyChanged (DependencyProperty *prop,
DependencyProperty *subprop);
};
Modified: trunk/moon/src/uielement.cpp
===================================================================
--- trunk/moon/src/uielement.cpp 2007-08-28 12:48:36 UTC (rev 84948)
+++ trunk/moon/src/uielement.cpp 2007-08-28 13:08:36 UTC (rev 84949)
@@ -261,7 +261,7 @@
cairo_matrix_transform_point (&inverse, &nx, &ny);
- if (cairo_in_stroke (cr, nx, ny) || (clip->CanFill () && cairo_in_fill
(cr, nx, ny)))
+ if (cairo_in_stroke (cr, nx, ny) || (clip->IsFilled () && cairo_in_fill
(cr, nx, ny)))
ret = true;
cairo_new_path (cr);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches