gnome-system-monitor r2481 - trunk/src



Author: bdejean
Date: Mon Aug 25 18:38:15 2008
New Revision: 2481
URL: http://svn.gnome.org/viewvc/gnome-system-monitor?rev=2481&view=rev

Log:
Fixed pie-button filling.
Closes #548853.


Modified:
   trunk/src/gsm_color_button.c

Modified: trunk/src/gsm_color_button.c
==============================================================================
--- trunk/src/gsm_color_button.c	(original)
+++ trunk/src/gsm_color_button.c	Mon Aug 25 18:38:15 2008
@@ -310,9 +310,10 @@
 	radius = width / 2;
       else
 	radius = height / 2;
-      arc_start =
-	((2 * G_PI) * (-1 * color_button->priv->fraction)) - (0.5 * G_PI);
-      arc_end = -1 * (G_PI / 2);
+
+      arc_start = -G_PI_2 + 2 * G_PI * color_button->priv->fraction;
+      arc_end = -G_PI_2;
+
       cairo_set_line_width (cr, 1);
       
       // Draw external stroke and fill
@@ -323,11 +324,11 @@
         cairo_arc (cr, (width / 2) + .5, (height / 2) + .5, radius - 2.25,
 		   0, 2 * G_PI);
       } else {
-        cairo_arc (cr, (width / 2) + .5, (height / 2) + .5, radius - 2.25,
+        cairo_arc_negative (cr, (width / 2) + .5, (height / 2) + .5, radius - 2.25,
 		   arc_start, arc_end);
-        cairo_arc (cr, (width / 2) + .5, (height / 2) + .5, 4.5,
+        cairo_arc_negative (cr, (width / 2) + .5, (height / 2) + .5, 4.5,
 		   arc_end, arc_start);
-        cairo_arc (cr, (width / 2) + .5, (height / 2) + .5, radius - 2.25,
+        cairo_arc_negative (cr, (width / 2) + .5, (height / 2) + .5, radius - 2.25,
 		   arc_start, arc_start);
       }
       cairo_fill_preserve (cr);
@@ -345,13 +346,13 @@
         cairo_arc (cr, (width / 2) + .5, (height / 2) + .5, radius - 3.5,
 			    0, 2 * G_PI);
       } else {
-        cairo_arc (cr, (width / 2) + .5, (height / 2) + .5, radius - 3.5,
+        cairo_arc_negative (cr, (width / 2) + .5, (height / 2) + .5, radius - 3.5,
 		 arc_start + (1 / (radius - 3.75)), 
 		 arc_end - (1 / (radius - 3.75)));
-        cairo_arc (cr, (width / 2) + .5, (height / 2) + .5, 3.25,
+        cairo_arc_negative (cr, (width / 2) + .5, (height / 2) + .5, 3.25,
 		   arc_end - (1 / (radius - 3.75)),
                    arc_start + (1 / (radius - 3.75)));
-        cairo_arc (cr, (width / 2) + .5, (height / 2) + .5, radius - 3.5,
+        cairo_arc_negative (cr, (width / 2) + .5, (height / 2) + .5, radius - 3.5,
 		 arc_start + (1 / (radius - 3.75)), 
 		 arc_start + (1 / (radius - 3.75)));
       }



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