diff --git a/pd/src/g_canvas.c b/pd/src/g_canvas.c index 8b4c677346b10b7c790e5bbd08a10993eadb3618..00225d94725d65ad9d7a797ed7863b1591491df6 100644 --- a/pd/src/g_canvas.c +++ b/pd/src/g_canvas.c @@ -2399,7 +2399,7 @@ void canvasgop__motionhook(t_scalehandle *sh, t_floatarg mouse_x, that is being used to draw the gop red rect move anchor atm. So rather than muck around with that code, we just set a pointer to whatever our toplevel is here: */ - t_glist *owner = canvas_getrootfor(x); + t_glist *owner = glist_getcanvas(x); /* Just unvis the object, then vis it once we've done our mutation and checks */ gobj_vis((t_gobj *)x, owner, 0); diff --git a/pd/src/g_graph.c b/pd/src/g_graph.c index 50173294a3d153bf17c638ab822bf2cdca39f599..5e1daa11a2ff63738b8fdeddc5d2aedf9bcbe598 100644 --- a/pd/src/g_graph.c +++ b/pd/src/g_graph.c @@ -879,6 +879,7 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) char tag[50]; t_gobj *g; int x1, y1, x2, y2; + t_rtext *rtext; /* ordinary subpatches: just act like a text object */ if (!x->gl_isgraph) { @@ -886,6 +887,14 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) return; } + /* Sanity check */ + rtext = glist_findrtext(parent_glist, &x->gl_obj); + if (!rtext) + { + bug("graph_vis"); + return; + } + sprintf(tag, "%s", rtext_gettag(rtext)); // weird exception //int exception = 0; //t_canvas* tgt = glist_getcanvas(x->gl_owner); @@ -896,8 +905,6 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) //} //fprintf(stderr,"tgt=.x%lx %d\n", (t_int)tgt, exception); - sprintf(tag, "%s", rtext_gettag(glist_findrtext(parent_glist, &x->gl_obj))); - if (vis & gobj_shouldvis(gr, parent_glist)) { int xpix, ypix;