diff --git a/pd/src/g_template.c b/pd/src/g_template.c index f1da4444818e5313dcb1467f70555635e36ee2dc..f4d8e2c591f59e292f5e0cfc19747e7f5e891b67 100644 --- a/pd/src/g_template.c +++ b/pd/src/g_template.c @@ -1175,6 +1175,8 @@ typedef struct _drawimage t_pd *x_attr; } t_drawimage; +extern t_outlet *obj_rightmost_outlet(t_object *x); + void draw_notifyforscalar(t_object *x, t_glist *owner, t_scalar *sc, t_symbol *s, int argc, t_atom *argv) { @@ -1187,8 +1189,15 @@ void draw_notifyforscalar(t_object *x, t_glist *owner, binbuf_add(b, 1, at); binbuf_add(b, argc, argv); if (x) - outlet_anything(x->ob_outlet, s, binbuf_getnatom(b), + { + t_outlet *out; + if (pd_class(&x->te_pd) == canvas_class) + out = obj_rightmost_outlet(x); + else + out = x->ob_outlet; + outlet_anything(out, s, binbuf_getnatom(b), binbuf_getvec(b)); + } gpointer_unset(&gp); binbuf_free(b); } diff --git a/pd/src/m_obj.c b/pd/src/m_obj.c index 8849a53a3591f27b7c6ebd085464814eb5af19e8..5fffe35f2d0d96aadf2f1e443eb8397456e06beb 100644 --- a/pd/src/m_obj.c +++ b/pd/src/m_obj.c @@ -579,6 +579,20 @@ int obj_noutlets(t_object *x) return (n); } +/* used for draw_notify */ +t_outlet *obj_rightmost_outlet(t_object *x) +{ + t_outlet *o = x->ob_outlet; + if (o) + { + while (o->o_next) + o = o->o_next; + return o; + } + else + return 0; +} + int obj_ninlets(t_object *x) { int n;