Author: spouliot
Date: 2007-12-10 15:02:16 -0500 (Mon, 10 Dec 2007)
New Revision: 91059
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/shape.cpp
Log:
shape.cpp: Fix Shape::GetSizeForBrush to adjust to the Stretch property of the
Shape. Fix bug #346018
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-12-10 19:41:14 UTC (rev 91058)
+++ trunk/moon/src/ChangeLog 2007-12-10 20:02:16 UTC (rev 91059)
@@ -1,3 +1,8 @@
+2007-12-10 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * shape.cpp: Fix Shape::GetSizeForBrush to adjust to the Stretch
+ property of the Shape. Fix bug #346018
+
2007-12-10 Jeffrey Stedfast <[EMAIL PROTECTED]>
* runtime.cpp (InitializeDrawingArea): Removed the call to
Modified: trunk/moon/src/shape.cpp
===================================================================
--- trunk/moon/src/shape.cpp 2007-12-10 19:41:14 UTC (rev 91058)
+++ trunk/moon/src/shape.cpp 2007-12-10 20:02:16 UTC (rev 91059)
@@ -305,8 +305,26 @@
void
Shape::GetSizeForBrush (cairo_t *cr, double *width, double *height)
{
- *height = framework_element_get_height (this);
- *width = framework_element_get_width (this);
+ double h = framework_element_get_height (this);
+ double w = framework_element_get_width (this);
+ Stretch stretch = shape_get_stretch (this);
+ switch (stretch) {
+ case StretchUniform:
+ w = h = (w < h) ? w : h;
+ break;
+ case StretchUniformToFill:
+ w = h = (w > h) ? w : h;
+ break;
+ case StretchFill:
+ /* nothing needed here. the assignment of w/h above
+ is correct for this case. */
+ break;
+ case StretchNone:
+ break;
+ }
+
+ *height = h;
+ *width = w;
}
bool
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches