From 282671282b20fa17ab9dbbaba9d1cf2246b5029d Mon Sep 17 00:00:00 2001 From: Miller Puckette Date: Mon, 17 Aug 2009 23:31:36 +0000 Subject: merge in new tcl implementation by Steiner & Chun svn path=/trunk/; revision=11934 --- pd/src/g_editor.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'pd/src/g_editor.c') 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); -- cgit v1.2.1