aboutsummaryrefslogtreecommitdiff
path: root/pd/src/g_editor.c
diff options
context:
space:
mode:
Diffstat (limited to 'pd/src/g_editor.c')
-rw-r--r--pd/src/g_editor.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c
index 0fbce41a..7ef5266a 100644
--- a/pd/src/g_editor.c
+++ b/pd/src/g_editor.c
@@ -1421,7 +1421,7 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which,
}
}
-void canvas_mousedown(t_canvas *x, t_floatarg xpos, t_floatarg ypos,
+void canvas_mouse(t_canvas *x, t_floatarg xpos, t_floatarg ypos,
t_floatarg which, t_floatarg mod)
{
canvas_doclick(x, xpos, ypos, which, mod, 1);
@@ -2454,9 +2454,9 @@ bad:
(sink? class_getname(pd_class(&sink->g_pd)) : "???"));
}
-#define XTOLERANCE 4
-#define YTOLERANCE 3
-#define NHIST 15
+#define XTOLERANCE 18
+#define YTOLERANCE 17
+#define NHIST 35
/* LATER might have to speed this up */
static void canvas_tidy(t_canvas *x)
@@ -2514,10 +2514,10 @@ static void canvas_tidy(t_canvas *x)
}
}
}
- for (i = 1, besthist = 0, bestdist = 4, ip = histogram + 1;
- i < (NHIST-1); i++, ip++)
+ for (i = 2, besthist = 0, bestdist = 4, ip = histogram + 2;
+ i < (NHIST-2); i++, ip++)
{
- int hit = ip[-1] + 2 * ip[0] + ip[1];
+ int hit = ip[-2] + 2 * ip[-1] + 3 * ip[0] + 2* ip[1] + ip[2];
if (hit > besthist)
{
besthist = hit;
@@ -2665,7 +2665,7 @@ static void glist_setlastxy(t_glist *gl, int xval, int yval)
void g_editor_setup(void)
{
/* ------------------------ events ---------------------------------- */
- class_addmethod(canvas_class, (t_method)canvas_mousedown, gensym("mouse"),
+ class_addmethod(canvas_class, (t_method)canvas_mouse, gensym("mouse"),
A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_NULL);
class_addmethod(canvas_class, (t_method)canvas_mouseup, gensym("mouseup"),
A_FLOAT, A_FLOAT, A_FLOAT, A_NULL);