Commit 0c5703e9 authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

*reverted commit 46933bb2 as it deemed...

*reverted commit 46933bb2 as it deemed unnecessary (it was designed to support buggy backwards-compatible behavior that defies common UI practices).
*further enhanced getrect calculation for the mycanvas widget to disallow clicking through a canvas across its entire size, rather than just the area by which one can "grab" and move the widget
parent 557df89f
...@@ -3017,8 +3017,6 @@ static double canvas_upclicktime; ...@@ -3017,8 +3017,6 @@ static double canvas_upclicktime;
static int canvas_upx, canvas_upy; static int canvas_upx, canvas_upy;
#define DCLICKINTERVAL 0.25 #define DCLICKINTERVAL 0.25
extern t_class *my_canvas_class; // for ignoring runtime clicks
/* mouse click */ /* mouse click */
void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, void canvas_doclick(t_canvas *x, int xpos, int ypos, int which,
int mod, int doit) int mod, int doit)
...@@ -3131,8 +3129,8 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, ...@@ -3131,8 +3129,8 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which,
if (canvas_hitbox(x, y, xpos, ypos, &x1, &y1, &x2, &y2)) if (canvas_hitbox(x, y, xpos, ypos, &x1, &y1, &x2, &y2))
{ {
ob = pd_checkobject(&y->g_pd); ob = pd_checkobject(&y->g_pd);
/* do not give clicks to comments or cnv during runtime */ /* do not give clicks to comments during runtime */
if (!ob || (ob->te_type != T_TEXT && ob->ob_pd != my_canvas_class)) if (!ob || ob->te_type != T_TEXT)
yclick = y; yclick = y;
//fprintf(stderr," MAIN found clickable %d\n", //fprintf(stderr," MAIN found clickable %d\n",
// clickreturned); // clickreturned);
......
...@@ -1483,8 +1483,6 @@ static void graph_motion(void *z, t_floatarg dx, t_floatarg dy) ...@@ -1483,8 +1483,6 @@ static void graph_motion(void *z, t_floatarg dx, t_floatarg dy)
garray_redraw(a); garray_redraw(a);
} }
extern t_class *my_canvas_class; // for ignoring runtime clicks
static int graph_click(t_gobj *z, struct _glist *glist, static int graph_click(t_gobj *z, struct _glist *glist,
int xpix, int ypix, int shift, int alt, int dbl, int doit) int xpix, int ypix, int shift, int alt, int dbl, int doit)
{ {
...@@ -1519,8 +1517,8 @@ static int graph_click(t_gobj *z, struct _glist *glist, ...@@ -1519,8 +1517,8 @@ static int graph_click(t_gobj *z, struct _glist *glist,
if (canvas_hitbox(x, y, xpix, ypix, &x1, &y1, &x2, &y2)) if (canvas_hitbox(x, y, xpix, ypix, &x1, &y1, &x2, &y2))
{ {
ob = pd_checkobject(&y->g_pd); ob = pd_checkobject(&y->g_pd);
/* do not give clicks to comments or cnv during runtime */ /* do not give clicks to comments during runtime */
if (!ob || (ob->te_type != T_TEXT && ob->ob_pd != my_canvas_class)) if (!ob || ob->te_type != T_TEXT)
clickme = y; clickme = y;
//fprintf(stderr," found clickable %d\n", clickreturned); //fprintf(stderr," found clickable %d\n", clickreturned);
} }
......
...@@ -149,9 +149,10 @@ static void my_canvas_getrect(t_gobj *z, t_glist *glist, ...@@ -149,9 +149,10 @@ static void my_canvas_getrect(t_gobj *z, t_glist *glist,
*xp1 = text_xpix(&x->x_gui.x_obj, glist); *xp1 = text_xpix(&x->x_gui.x_obj, glist);
*yp1 = text_ypix(&x->x_gui.x_obj, glist); *yp1 = text_ypix(&x->x_gui.x_obj, glist);
if (!glist_istoplevel(glist)) if (!glist_istoplevel(glist) || !glist->gl_edit)
{ {
//if we are trying to calculate visibility of a widget inside a GOP //if we are trying to calculate visibility of a widget inside a GOP
//or are calculating getrect during runtime
*xp2 = *xp1 + x->x_vis_w; *xp2 = *xp1 + x->x_vis_w;
*yp2 = *yp1 + x->x_vis_h; *yp2 = *yp1 + x->x_vis_h;
} }
......
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