diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2007-12-17 21:10:12 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2007-12-17 21:10:12 +0000 |
commit | b30725603fef60f6838fd97ccf1d90ebfb9ba95e (patch) | |
tree | 1bb452e64bccd9c0e9653cfb6a68812c8e05e4e0 | |
parent | 7ac46539d0876f1d6c7101afd35c6e39a9ee9372 (diff) |
Correct the cursor query.
-rw-r--r-- | src/summary-chart.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/summary-chart.c b/src/summary-chart.c index 661b37d..6f834ad 100644 --- a/src/summary-chart.c +++ b/src/summary-chart.c @@ -350,8 +350,6 @@ _summary_chart_get_sum_for_cursor (SummaryChart *self, gint x, gint y) return NULL; cursor = atan2 (dy, dx); - if (cursor < -G_PI / 2) - cursor += 2 * G_PI; total = 0; for (n = 0; n < allocators->len; n++) { @@ -359,7 +357,7 @@ _summary_chart_get_sum_for_cursor (SummaryChart *self, gint x, gint y) total += sort == ALLOCATORS_STORE_SORT_BY_SIZE ? sum->size : sum->count; } - min = total / (G_PI * r); + min = total / (G_PI * R); theta = 0; for (n = 0; n < allocators->len; n++) { struct _sum_allocator *sum = g_ptr_array_index (allocators, n); @@ -374,6 +372,8 @@ _summary_chart_get_sum_for_cursor (SummaryChart *self, gint x, gint y) } } theta_offset = -G_PI / 2 + (2 * G_PI - theta) / 2.; + if (cursor < theta_offset) + cursor += 2 * G_PI; theta = theta_offset; |