Commit 46933bb2 authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

*fixed regression where cnv objects captured runtime clicks due to pd-l2ork's...

*fixed regression where cnv objects captured runtime clicks due to pd-l2ork's passing of the click to the topmost visible object, rather than the first clickable object in the stack. This also fixes problems with legacy patches that rely vanilla/extended's assignment of click to the lowest, and as is the case with s-env-help.pd in s-abstractions, invisible object, rather than the one apparent to the user.
parent 97a2dda5
......@@ -3008,6 +3008,8 @@ static double canvas_upclicktime;
static int canvas_upx, canvas_upy;
#define DCLICKINTERVAL 0.25
extern t_class *my_canvas_class; // for ignoring runtime clicks
/* mouse click */
void canvas_doclick(t_canvas *x, int xpos, int ypos, int which,
int mod, int doit)
......@@ -3120,8 +3122,8 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which,
if (canvas_hitbox(x, y, xpos, ypos, &x1, &y1, &x2, &y2))
{
ob = pd_checkobject(&y->g_pd);
/* do not give clicks to comments during runtime */
if (!ob || ob->te_type != T_TEXT)
/* do not give clicks to comments or cnv during runtime */
if (!ob || (ob->te_type != T_TEXT && ob->ob_pd != my_canvas_class))
yclick = y;
//fprintf(stderr," MAIN found clickable %d\n",
// clickreturned);
......
......@@ -1483,6 +1483,8 @@ static void graph_motion(void *z, t_floatarg dx, t_floatarg dy)
garray_redraw(a);
}
extern t_class *my_canvas_class; // for ignoring runtime clicks
static int graph_click(t_gobj *z, struct _glist *glist,
int xpix, int ypix, int shift, int alt, int dbl, int doit)
{
......@@ -1517,8 +1519,8 @@ static int graph_click(t_gobj *z, struct _glist *glist,
if (canvas_hitbox(x, y, xpix, ypix, &x1, &y1, &x2, &y2))
{
ob = pd_checkobject(&y->g_pd);
/* do not give clicks to comments during runtime */
if (!ob || ob->te_type != T_TEXT)
/* do not give clicks to comments or cnv during runtime */
if (!ob || (ob->te_type != T_TEXT && ob->ob_pd != my_canvas_class))
clickme = y;
//fprintf(stderr," found clickable %d\n", clickreturned);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment