Commit c5f5a579 authored by Jonathan Wilkes's avatar Jonathan Wilkes

use recursive call to gobj_shouldvis to suppress nested gop drawings, also

remove redundant call in g_mycanvas.c and filter repeated label updates if
the label hasn't changed as in Pd Vanilla
parent 4ccf4c8c
......@@ -231,19 +231,15 @@ void iemgui_receive(t_iemgui *x, t_symbol *s)
void iemgui_label(t_iemgui *x, t_symbol *s)
{
t_symbol *old;
if (s == &s_) s = s_empty; //tb: fix for empty label
old = x->x_lab;
t_symbol *lab = iemgui_raute2dollar(s);
x->x_lab_unexpanded = lab;
x->x_lab = lab = canvas_realizedollar(x->x_glist, lab);
if(glist_isvisible(x->x_glist))
{
gui_vmess("gui_iemgui_label_set", "xxs",
glist_getcanvas(x->x_glist),
x,
s != s_empty ? x->x_lab->s_name : "");
if (glist_isvisible(x->x_glist) && lab != old)
iemgui_shouldvis(x, IEM_GUI_DRAW_MODE_CONFIG);
}
}
void iemgui_label_pos(t_iemgui *x, t_symbol *s, int ac, t_atom *av)
......
......@@ -220,6 +220,13 @@ int gobj_shouldvis(t_gobj *x, struct _glist *glist)
//fprintf(stderr,"shouldvis %d %d %d %d\n",
// glist->gl_havewindow, glist->gl_isgraph,
// glist->gl_goprect, glist->gl_owner != NULL);
/* if our parent is a graph, and if that graph itself isn't
visible, then we aren't either. */
if (!glist->gl_havewindow && glist->gl_isgraph && glist->gl_owner
&& !gobj_shouldvis(&glist->gl_gobj, glist->gl_owner))
return (0);
/* if we're graphing-on-parent and the object falls outside the
graph rectangle, don't draw it. */
if (!glist->gl_havewindow && glist->gl_isgraph && glist->gl_goprect &&
glist->gl_owner && (pd_class(&x->g_pd) != scalar_class) &&
(pd_class(&x->g_pd) != garray_class))
......@@ -2880,7 +2887,7 @@ static void canvas_donecanvasdialog(t_glist *x,
{
glist_noselect(x);
gobj_vis(&x->gl_gobj, x->gl_owner, 0);
if (gobj_shouldvis(&x->gl_obj, x->gl_owner))
if (gobj_shouldvis(&x->gl_gobj, x->gl_owner))
{
gobj_vis(&x->gl_gobj, x->gl_owner, 1);
//fprintf(stderr,"yes\n");
......
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