goffice r2111 - in branches/goffice-0-6: . goffice/graph goffice/gtk



Author: jbrefort
Date: Fri Jun 20 19:25:54 2008
New Revision: 2111
URL: http://svn.gnome.org/viewvc/goffice?rev=2111&view=rev

Log:
2008-06-20  Jean Brefort  <jean brefort normalesup org>

	* goffice/graph/gog-style.c: (gog_style_create_cairo_pattern): fixed
	gradients coordinates.
	* goffice/gtk/go-gradient-selector.c:
	(go_gradient_swatch_render_func): ditto.



Modified:
   branches/goffice-0-6/ChangeLog
   branches/goffice-0-6/goffice/graph/gog-style.c
   branches/goffice-0-6/goffice/gtk/go-gradient-selector.c

Modified: branches/goffice-0-6/goffice/graph/gog-style.c
==============================================================================
--- branches/goffice-0-6/goffice/graph/gog-style.c	(original)
+++ branches/goffice-0-6/goffice/graph/gog-style.c	Fri Jun 20 19:25:54 2008
@@ -2117,8 +2117,8 @@
 			return go_pattern_create_cairo_pattern (&style->fill.pattern, cr);
 
 		case GOG_FILL_STYLE_GRADIENT:
-			x[2] = (x[1] - x[0]) / 2.0 + x[1];
-			y[2] = (y[1] - y[0]) / 2.0 + y[1];
+			x[2] = (x[1] - x[0]) / 2.0 + x[0];
+			y[2] = (y[1] - y[0]) / 2.0 + y[0];
 			cr_pattern = cairo_pattern_create_linear (
 				x[grad_i[style->fill.gradient.dir].x0i],
 				y[grad_i[style->fill.gradient.dir].y0i],

Modified: branches/goffice-0-6/goffice/gtk/go-gradient-selector.c
==============================================================================
--- branches/goffice-0-6/goffice/gtk/go-gradient-selector.c	(original)
+++ branches/goffice-0-6/goffice/gtk/go-gradient-selector.c	Fri Jun 20 19:25:54 2008
@@ -64,8 +64,8 @@
 	y[0] = area->y;
 	x[1] = area->x + area->width;
 	y[1] = area->y + area->height;
-	x[2] = (x[1] - x[0]) / 2.0 + x[1];
-	y[2] = (y[1] - y[0]) / 2.0 + y[1];
+	x[2] = (x[1] - x[0]) / 2.0 + x[0];
+	y[2] = (y[1] - y[0]) / 2.0 + y[0];
 	cr_pattern = cairo_pattern_create_linear (x[grad_i[index].x0i], 
 						  y[grad_i[index].y0i],
 						  x[grad_i[index].x1i],



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]