Skip to content
Snippets Groups Projects
Commit 2520a127 authored by Ivica Ico Bukvic's avatar Ivica Ico Bukvic
Browse files

improved autopatching and noautopatch logic

parent 7547d506
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,8 @@ static void text_displace(t_gobj *z, t_glist *glist, ...@@ -26,6 +26,8 @@ static void text_displace(t_gobj *z, t_glist *glist,
int dx, int dy); int dx, int dy);
static void text_getrect(t_gobj *z, t_glist *glist, static void text_getrect(t_gobj *z, t_glist *glist,
int *xp1, int *yp1, int *xp2, int *yp2); int *xp1, int *yp1, int *xp2, int *yp2);
void canvas_howputnew(t_canvas *x, int *connectp, int *xpixp, int *ypixp,
int *indexp, int *totalp);
void canvas_startmotion(t_canvas *x); void canvas_startmotion(t_canvas *x);
t_widgetbehavior text_widgetbehavior; t_widgetbehavior text_widgetbehavior;
...@@ -66,13 +68,15 @@ void glist_text(t_glist *gl, t_symbol *s, int argc, t_atom *argv) ...@@ -66,13 +68,15 @@ void glist_text(t_glist *gl, t_symbol *s, int argc, t_atom *argv)
} }
else else
{ {
int xpix, ypix; //int xpix, ypix;
int connectme, xpix, ypix, indx, nobj;
canvas_howputnew(gl, &connectme, &xpix, &ypix, &indx, &nobj);
pd_vmess((t_pd *)glist_getcanvas(gl), gensym("editmode"), "i", 1); pd_vmess((t_pd *)glist_getcanvas(gl), gensym("editmode"), "i", 1);
SETSYMBOL(&at, gensym("comment")); SETSYMBOL(&at, gensym("comment"));
glist_noselect(gl); glist_noselect(gl);
glist_getnextxy(gl, &xpix, &ypix); //glist_getnextxy(gl, &xpix, &ypix);
x->te_xpix = xpix-1; x->te_xpix = xpix;
x->te_ypix = ypix-1; x->te_ypix = ypix;
binbuf_restore(x->te_binbuf, 1, &at); binbuf_restore(x->te_binbuf, 1, &at);
glist_add(gl, &x->te_g); glist_add(gl, &x->te_g);
glist_noselect(gl); glist_noselect(gl);
...@@ -205,7 +209,7 @@ void canvas_howputnew(t_canvas *x, int *connectp, int *xpixp, int *ypixp, ...@@ -205,7 +209,7 @@ void canvas_howputnew(t_canvas *x, int *connectp, int *xpixp, int *ypixp,
connectme = (obj_noutlets(ob) ? 1 : 0); connectme = (obj_noutlets(ob) ? 1 : 0);
}*/ }*/
int connectme = (x->gl_editor->e_selection && int connectme = (x->gl_editor->e_selection &&
!x->gl_editor->e_selection->sel_next && !sys_noautopatch); !x->gl_editor->e_selection->sel_next);
if (connectme) if (connectme)
{ {
t_gobj *g, *selected = x->gl_editor->e_selection->sel_what; t_gobj *g, *selected = x->gl_editor->e_selection->sel_what;
...@@ -238,6 +242,7 @@ void canvas_howputnew(t_canvas *x, int *connectp, int *xpixp, int *ypixp, ...@@ -238,6 +242,7 @@ void canvas_howputnew(t_canvas *x, int *connectp, int *xpixp, int *ypixp,
glist_getnextxy(x, xpixp, ypixp); glist_getnextxy(x, xpixp, ypixp);
glist_noselect(x); glist_noselect(x);
} }
if (sys_noautopatch) connectme = 0;
*connectp = connectme; *connectp = connectme;
*indexp = indx; *indexp = indx;
*totalp = nobj; *totalp = nobj;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment