Commit e62a7950 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

port from Pd-l2ork: b0a8c407b3014459406a742268326f3636ae3406

further refined legacy mode to match both iemgui and graph-on-parent objects.
parent b0fe38c5
......@@ -528,7 +528,7 @@ static void *bng_new(t_symbol *s, int argc, t_atom *argv)
x->x_gui.x_changed = -1;
x->x_gui.legacy_x = 0;
x->x_gui.legacy_y = 0;
x->x_gui.legacy_y = 1;
//x->x_gui.click_x = 1;
//x->x_gui.click_y = 2;
......
......@@ -802,7 +802,7 @@ void canvas_drawredrect(t_canvas *x, int doit)
{
if (doit)
{
int x1=x->gl_xmargin, y1=x->gl_ymargin;
int x1=x->gl_xmargin, y1=x->gl_ymargin + sys_legacy;
int x2=x1+x->gl_pixwidth, y2=y1+x->gl_pixheight;
//sys_vgui(".x%lx.c create line "
// "%d %d %d %d %d %d %d %d %d %d -fill #ff8080 -tags GOP\n",
......
......@@ -919,6 +919,12 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
// conditional
graph_getrect(gr, parent_glist, &x1, &y1, &x2, &y2);
//fprintf(stderr,"%d %d %d %d\n", x1, y1, x2, y2);
if (sys_legacy == 1)
{
//fprintf(stderr,"legacy gop\n");
y1 += 1;
y2 += 1;
}
if (!vis)
rtext_erase(glist_findrtext(parent_glist, &x->gl_obj));
......@@ -1375,6 +1381,15 @@ static void graph_getrect(t_gobj *z, t_glist *glist,
}*/
}
else text_widgetbehavior.w_getrectfn(z, glist, &x1, &y1, &x2, &y2);
if (sys_legacy == 1)
{
//fprintf(stderr,"legacy gop\n");
y1 += 1;
y2 += 1;
}
//fprintf(stderr," post %d %d %d %d\n", x1, y1, x2, y2);
*xp1 = x1;
*yp1 = y1;
*xp2 = x2;
......
......@@ -374,7 +374,7 @@ static void *my_canvas_new(t_symbol *s, int argc, t_atom *argv)
x->x_gui.x_obj.te_iemgui = 1;
x->x_gui.legacy_x = 0;
x->x_gui.legacy_y = 0;
x->x_gui.legacy_y = 1;
return (x);
}
......
......@@ -847,7 +847,7 @@ static void *my_numbox_new(t_symbol *s, int argc, t_atom *argv)
x->x_gui.x_changed = 0;
x->x_gui.legacy_x = 0;
x->x_gui.legacy_y = 0;
x->x_gui.legacy_y = 1;
return (x);
}
......
......@@ -531,7 +531,7 @@ static void *radio_new(t_symbol *s, int argc, t_atom *argv)
x->x_gui.x_obj.te_iemgui = 1;
x->x_gui.legacy_x = 0;
x->x_gui.legacy_y = 0;
x->x_gui.legacy_y = 1;
return (x);
}
......
......@@ -599,10 +599,10 @@ static void *slider_new(t_symbol *s, int argc, t_atom *argv)
if (x->x_orient)
{
x->x_gui.legacy_x = 0;
x->x_gui.legacy_y = -2;
x->x_gui.legacy_y = -1;
} else {
x->x_gui.legacy_x = -3;
x->x_gui.legacy_y = 0;
x->x_gui.legacy_y = 1;
}
......
......@@ -422,7 +422,7 @@ static void *toggle_new(t_symbol *s, int argc, t_atom *argv)
x->x_gui.x_changed = 1;
x->x_gui.legacy_x = 0;
x->x_gui.legacy_y = 0;
x->x_gui.legacy_y = 1;
//x->x_gui.click_x = 1;
//x->x_gui.click_y = 2;
......
......@@ -751,7 +751,7 @@ static void *vu_new(t_symbol *s, int argc, t_atom *argv)
x->x_gui.x_obj.te_iemgui = 1;
x->x_gui.legacy_x = -1;
x->x_gui.legacy_y = -2;
x->x_gui.legacy_y = -1;
return (x);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment