diff --git a/pd/src/g_canvas.c b/pd/src/g_canvas.c index d3ed51dab44bf74937fcc6d2a66a9f6b9094c246..ef28e956c16b1427580340bcc69127dc28adf205 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 fcaa0b44babeb15240c7b6d364fdce636f56a37a..f1a166da2854bb93a08ef9c4f7a19e56a2a0a9f4 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;