Author: stephane
Date: 2008-02-06 08:46:51 -0500 (Wed, 06 Feb 2008)
New Revision: 95024
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/brush.cpp
Log:
2008-02-06 Stephane Delcroix <[EMAIL PROTECTED]>
* brush.cpp: fix the radialgradientbrush setup.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2008-02-06 13:44:23 UTC (rev 95023)
+++ trunk/moon/src/ChangeLog 2008-02-06 13:46:51 UTC (rev 95024)
@@ -1,3 +1,7 @@
+2008-02-06 Stephane Delcroix <[EMAIL PROTECTED]>
+
+ * brush.cpp: fix the radialgradientbrush setup.
+
2008-02-05 Chris Toshok <[EMAIL PROTECTED]>
* collection.cpp (Collection::EmitChanged): new method. Emit the
Modified: trunk/moon/src/brush.cpp
===================================================================
--- trunk/moon/src/brush.cpp 2008-02-06 13:44:23 UTC (rev 95023)
+++ trunk/moon/src/brush.cpp 2008-02-06 13:46:51 UTC (rev 95024)
@@ -609,15 +609,19 @@
double rx = radial_gradient_brush_get_radius_x (this);
double ry = radial_gradient_brush_get_radius_y (this);
- cairo_pattern_t *pattern = cairo_pattern_create_radial (ox, oy, 0.0,
cx, cy, ry);
-
+ cairo_pattern_t *pattern = cairo_pattern_create_radial (ox/rx, oy/ry,
0.0, cx/rx, cy/ry, 1);
+
cairo_matrix_t matrix;
switch (gradient_brush_get_mapping_mode (this)) {
case BrushMappingModeAbsolute:
- cairo_matrix_init_identity (&matrix);
+ cairo_matrix_init_translate (&matrix, cx, cy);
+ cairo_matrix_scale (&matrix, rx, ry);
+ cairo_matrix_translate (&matrix, -cx/rx, -cy/ry);
break;
case BrushMappingModeRelativeToBoundingBox:
- cairo_matrix_init (&matrix, width * rx / ry, 0, 0, height, 0,
0);
+ cairo_matrix_init_translate (&matrix, cx * width, cy * height);
+ cairo_matrix_scale (&matrix, width * rx, height * ry );
+ cairo_matrix_translate (&matrix, -cx/rx, -cy/ry);
break;
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches