summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2012-09-17 15:54:15 -0400
committerWilliam Jon McCann <jmccann@redhat.com>2012-09-17 17:48:12 -0400
commitb5d1b84eb391248820363a94265b3a04ec57845b (patch)
treefd00beaec0f4a831ea7768cbd33a45671959db6f
parent26571124c724d996cfa5c7719dc36e1b72223100 (diff)
downloadnautilus-b5d1b84eb391248820363a94265b3a04ec57845b.tar.gz
Paint the used space on top of the others
Looks better to have those strokes be on top. https://bugzilla.gnome.org/show_bug.cgi?id=559311
-rw-r--r--src/nautilus-properties-window.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index de8ce20a4..e3944795a 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -2663,7 +2663,7 @@ paint_slice (cairo_t *cr,
double y,
double radius,
double percent_start,
- double percent_end,
+ double percent_width,
const GdkRGBA *fill,
const GdkRGBA *stroke)
{
@@ -2672,10 +2672,14 @@ paint_slice (cairo_t *cr,
gboolean full;
double offset = G_PI / 2.0;
+ if (percent_width < .01) {
+ return;
+ }
+
angle1 = (percent_start * 2 * G_PI) - offset;
- angle2 = (percent_end * 2 * G_PI) - offset;
+ angle2 = angle1 + (percent_width * 2 * G_PI);
- full = ((percent_end - percent_start) > .99);
+ full = (percent_width > .99);
if (!full) {
cairo_move_to (cr, x, y);
@@ -2735,18 +2739,16 @@ paint_pie_chart (GtkWidget *widget,
radius = height / 2 - 8;
}
- /* first fill in a complete circle so we don't look dumb if
- missing a piece */
paint_slice (cr, xc, yc, radius,
- 0, 1,
+ 0, free,
+ &window->details->free_color, &window->details->free_stroke_color);
+ paint_slice (cr, xc, yc, radius,
+ free + used, reserved,
&window->details->unknown_color, &window->details->unknown_stroke_color);
-
+ /* paint the used last so its slice strokes are on top */
paint_slice (cr, xc, yc, radius,
- reserved, reserved + used,
+ free, used,
&window->details->used_color, &window->details->used_stroke_color);
- paint_slice (cr, xc, yc, radius,
- reserved + used, reserved + used + free,
- &window->details->free_color, &window->details->free_stroke_color);
}