diff --git a/externals/miXed/cyclone/sickle/Scope.c b/externals/miXed/cyclone/sickle/Scope.c index 241a32ac936fb26ff2fc69cb7a46807c9aa2b7b7..eba867e9066622ba138741a3b2204bcddded71ba 100644 --- a/externals/miXed/cyclone/sickle/Scope.c +++ b/externals/miXed/cyclone/sickle/Scope.c @@ -1022,6 +1022,14 @@ static void scopehandle__clickhook(t_scopehandle *sh, t_floatarg f, t_floatarg x sh->h_dragon = newstate; } +/* wrapper method for forwarding "scopehandle" data */ +static void scope_click_for_resizing(t_scope *x, t_floatarg f, t_floatarg xxx, + t_floatarg yyy) +{ + t_scopehandle *sh = (t_scopehandle *)x->x_handle; + scopehandle__clickhook(sh, f, xxx, yyy); +} + static void scopehandle__motionhook(t_scopehandle *sh, t_floatarg f1, t_floatarg f2) { @@ -1140,6 +1148,11 @@ void Scope_tilde_setup(void) class_addmethod(scope_class, (t_method)scope_click, gensym("click"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0); + /* Big hack for receiving edit-mode resize anchor clicks from + g_editor.c. */ + class_addmethod(scope_class, (t_method)scope_click_for_resizing, + gensym("_click_for_resizing"), + A_FLOAT, A_FLOAT, A_FLOAT, 0); class_setwidget(scope_class, &scope_widgetbehavior); forky_setsavefn(scope_class, scope_save); scopehandle_class = class_new(gensym("_scopehandle"), 0, 0, diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c index 9163f030caa753f1e4de0e04b58d321da3925e46..9abae465e80079deee746a6b9e0f4578f1503ef0 100644 --- a/pd/src/g_editor.c +++ b/pd/src/g_editor.c @@ -3284,8 +3284,13 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, /* look for an outlet we just clicked onto */ int noutlet; int ninlet; - /* resize? only for "true" text boxes or canvases*/ - if (ob && ob->te_iemgui && xpos >= x2-4 && ypos > y2-6) + /* resize? only for "true" text boxes, canvases, iemguis, + and -- using an awful hack-- for the Scope~ object + by checking for the class name below */ + if (ob && + (ob->te_iemgui + || pd_class(&ob->te_pd)->c_name == gensym("Scope~")) + && xpos >= x2-4 && ypos > y2-6) { if (doit) { @@ -3294,9 +3299,17 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, x->gl_editor->e_ywas = y1; x->gl_editor->e_xnew = xpos; x->gl_editor->e_ynew = ypos; - t_pd *sh = (t_pd *)((t_iemgui *)ob)->x_handle; - pd_vmess(sh, gensym("_click"), "fff", - (t_float)1, (t_float)xpos, (t_float)ypos); + if (ob->te_iemgui) + { + t_pd *sh = (t_pd *)((t_iemgui *)ob)->x_handle; + pd_vmess(sh, gensym("_click"), "fff", + (t_float)1, (t_float)xpos, (t_float)ypos); + } + else + { + pd_vmess((t_pd *)ob, gensym("_click_for_resizing"), + "fff", (t_float)1, (t_float)xpos, (t_float)ypos); + } } else {