summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-12-17 21:10:12 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2007-12-17 21:10:12 +0000
commitb30725603fef60f6838fd97ccf1d90ebfb9ba95e (patch)
tree1bb452e64bccd9c0e9653cfb6a68812c8e05e4e0
parent7ac46539d0876f1d6c7101afd35c6e39a9ee9372 (diff)
Correct the cursor query.
-rw-r--r--src/summary-chart.c6
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;