diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c index ea840b3c02c7d87658d38be8a8165ecdb66e944f..913d698c918033a97b80279bdde208446bb98dbd 100644 --- a/pd/src/g_editor.c +++ b/pd/src/g_editor.c @@ -2782,6 +2782,7 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, int shiftmod, runmode, altmod, doublemod = 0, rightclick; int x1=0, y1=0, x2=0, y2=0, clickreturned = 0; t_gobj *yclick = NULL; + t_object *ob; //fprintf(stderr,"MAIN canvas_doclick %d %d %d %d %d\n", xpos, ypos, which, mod, doit); @@ -2859,8 +2860,9 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, for (y = x->gl_list; y; y = y->g_next) { // check if the object wants to be clicked (we pick the topmost clickable) - if (canvas_hitbox(x, y, xpos, ypos, &x1, &y1, &x2, &y2)) { - yclick = y; + if (canvas_hitbox(x, y, xpos, ypos, &x1, &y1, &x2, &y2) && (ob = pd_checkobject(&y->g_pd))) { + if (ob->te_type != T_TEXT) // do not give clicks to comments during runtime + yclick = y; //fprintf(stderr," MAIN found clickable %d\n", clickreturned); } } @@ -2888,7 +2890,6 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, /* if in editmode click, fall here. */ if (y = canvas_findhitbox(x, xpos, ypos, &x1, &y1, &x2, &y2)) { - t_object *ob; /* check you're in the rectangle */ ob = pd_checkobject(&y->g_pd); if (rightclick) diff --git a/pd/src/g_graph.c b/pd/src/g_graph.c index 8c34610a9e55cecc33879d76f0e5bd1b1984ed8f..51c60ac6c6d9a3d928f511ce8f1ce733024a789a 100644 --- a/pd/src/g_graph.c +++ b/pd/src/g_graph.c @@ -1364,9 +1364,11 @@ static int graph_click(t_gobj *z, struct _glist *glist, else { int x1, y1, x2, y2; - /* check if the object wants to be clicked */ - if (canvas_hitbox(x, y, xpix, ypix, &x1, &y1, &x2, &y2)) - clickme = y; + t_object *ob; + /* check if the object wants to be clicked and pick the topmost with the exception of the text (comment)*/ + if (canvas_hitbox(x, y, xpix, ypix, &x1, &y1, &x2, &y2) && (ob = pd_checkobject(&y->g_pd))) + if (ob->te_type != T_TEXT) // do not give clicks to comments during runtime + clickme = y; //fprintf(stderr," found clickable %d\n", clickreturned); } }