aboutsummaryrefslogtreecommitdiff
path: root/pd/src/g_template.c
diff options
context:
space:
mode:
Diffstat (limited to 'pd/src/g_template.c')
-rw-r--r--pd/src/g_template.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pd/src/g_template.c b/pd/src/g_template.c
index 69f1c864..b1046447 100644
--- a/pd/src/g_template.c
+++ b/pd/src/g_template.c
@@ -1524,7 +1524,9 @@ static void plot_getrect(t_gobj *z, t_glist *glist,
xfielddesc, yfielddesc, wfielddesc,
&xonset, &yonset, &wonset))
{
- for (i = 0, xsum = 0; i < array->a_n; i++)
+ /* if it has more than 2000 points, just check 1000 of them. */
+ int incr = (array->a_n <= 2000 ? 1 : array->a_n / 1000);
+ for (i = 0, xsum = 0; i < array->a_n; i += incr)
{
float usexloc, useyloc;
t_gobj *y;