Author: spouliot
Date: 2007-06-19 14:11:10 -0400 (Tue, 19 Jun 2007)
New Revision: 80218
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/shape.cpp
Log:
2007-06-19 Sebastien Pouliot <[EMAIL PROTECTED]>
* shape.cpp: Add Strech support for Rectangle (only None is different).
Add comments to Line as Stretch doesn't apply for this Shape.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-06-19 18:11:04 UTC (rev 80217)
+++ trunk/moon/src/ChangeLog 2007-06-19 18:11:10 UTC (rev 80218)
@@ -1,3 +1,8 @@
+2007-06-19 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * shape.cpp: Add Strech support for Rectangle (only None is different).
+ Add comments to Line as Stretch doesn't apply for this Shape.
+
2007-06-19 Miguel de Icaza <[EMAIL PROTECTED]>
* runtime.cpp (Collection): Add new Insert method, and update all
Modified: trunk/moon/src/shape.cpp
===================================================================
--- trunk/moon/src/shape.cpp 2007-06-19 18:11:04 UTC (rev 80217)
+++ trunk/moon/src/shape.cpp 2007-06-19 18:11:10 UTC (rev 80218)
@@ -503,14 +503,23 @@
void
Rectangle::Draw (Surface *s)
{
- double w = framework_element_get_width (this);
- double h = framework_element_get_height (this);
- double radius_x = rectangle_get_radius_x (this);
- if (radius_x != 0) {
- double radius_y = rectangle_get_radius_y (this);
- if (radius_y != 0) {
- moon_rounded_rectangle (s->cairo, 0, 0, w, h, radius_x,
radius_y);
- return;
+ double w, h;
+ // only StretchNone gets some special attention
+ Stretch stretch = shape_get_stretch (this);
+ if (stretch == StretchNone) {
+ // this gets us a single colored point at X,Y
+ w = 0.5;
+ h = 0.5;
+ } else {
+ w = framework_element_get_width (this);
+ h = framework_element_get_height (this);
+ double radius_x = rectangle_get_radius_x (this);
+ if (radius_x != 0) {
+ double radius_y = rectangle_get_radius_y (this);
+ if (radius_y != 0) {
+ moon_rounded_rectangle (s->cairo, 0, 0, w, h,
radius_x, radius_y);
+ return;
+ }
}
}
// normal rectangle
@@ -581,6 +590,9 @@
void
Line::Draw (Surface *s)
{
+ // Note: Shape::StretchProperty has no effect on lines
+ // Note: SL 1.1 alpha considers X2,Y2 as the start point (when drawing
end line caps)
+ // This doesn't affect us because Cairo doesn't support separate
start/end line caps
cairo_move_to (s->cairo, line_get_x1 (this), line_get_y1 (this));
cairo_line_to (s->cairo, line_get_x2 (this), line_get_y2 (this));
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches