gbrainy r311 - trunk/src



Author: jmas
Date: Tue Apr 29 22:54:57 2008
New Revision: 311
URL: http://svn.gnome.org/viewvc/gbrainy?rev=311&view=rev

Log:
Fixes colours

Modified:
   trunk/src/PuzzleExtraCircle.cs

Modified: trunk/src/PuzzleExtraCircle.cs
==============================================================================
--- trunk/src/PuzzleExtraCircle.cs	(original)
+++ trunk/src/PuzzleExtraCircle.cs	Tue Apr 29 22:54:57 2008
@@ -86,22 +86,28 @@
 
 	private void DrawSlice (CairoContextEx gr, double x, double y, double dg, Color color)
 	{
-		double x1, y1, degrees;
+		double x1, y1, smallest_x, smallest_y, degrees;
 
+		smallest_x = x;
+		smallest_y = y;
 		degrees = radian * (60 + dg);
 		gr.MoveTo (x, y);
 		x1 = x + radius * Math.Cos (degrees);
 		y1 = y + radius * Math.Sin (degrees);
 		gr.LineTo (x1, y1);
+		if (x1 < smallest_x) smallest_x = x1;
+		if (y1 < smallest_y) smallest_y = y1;
 		
 		degrees = dg * radian;
 		gr.MoveTo (x, y);
 		x1 = x + radius * Math.Cos (degrees);
 		y1 = y + radius * Math.Sin (degrees);
 		gr.LineTo (x1, y1);
+		if (x1 < smallest_x) smallest_x = x1;
+		if (y1 < smallest_y) smallest_y = y1;
 
 		gr.Arc (x, y, radius, dg * radian, radian * (60 + dg));
-		gr.FillGradient (x, y, radius, radius, color);
+		gr.FillGradient (smallest_x, smallest_y, radius, radius, color);
 		gr.Stroke ();
 	}
 



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