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

Merge branch 'garray-label-fix'

parents 307bacbb 986d511f
...@@ -554,7 +554,6 @@ function apply() { ...@@ -554,7 +554,6 @@ function apply() {
// If this is a dialog to create a new array // If this is a dialog to create a new array
// skip the canvas dialog callback // skip the canvas dialog callback
if (!new_array_dialog) { if (!new_array_dialog) {
// Note: the "+" casts Boolean to Number
gop = +get_input("gop"); gop = +get_input("gop");
hide_name = +get_input("hide_name"); hide_name = +get_input("hide_name");
......
...@@ -755,6 +755,7 @@ void garray_arraydialog(t_garray *x, t_symbol *s, int argc, t_atom *argv) ...@@ -755,6 +755,7 @@ void garray_arraydialog(t_garray *x, t_symbol *s, int argc, t_atom *argv)
x->x_style = style; x->x_style = style;
if (size != a->a_n) if (size != a->a_n)
{ {
glist_redraw(x->x_glist);
garray_resize_long(x, size); garray_resize_long(x, size);
} }
else else
...@@ -764,16 +765,15 @@ void garray_arraydialog(t_garray *x, t_symbol *s, int argc, t_atom *argv) ...@@ -764,16 +765,15 @@ void garray_arraydialog(t_garray *x, t_symbol *s, int argc, t_atom *argv)
happened to change it. Let me emphasize-- in order to happened to change it. Let me emphasize-- in order to
redraw array labels, we must call a function that redraws redraw array labels, we must call a function that redraws
not only the _entire_ array and its graph, but also redraws not only the _entire_ array and its graph, but also redraws
the parent canvas in which the graph is displayed. There is the graph in which the array is displayed. There is
no interface I can find to just say, "redraw the label". no interface I can find to just say, "redraw the label".
Worse, Pd redraws a single array at least 3 times, and maybe Worse, Pd redraws a single array at least 3 times-- hard to tell
even the graph and the containing glist-- it's hard to tell
because so much data is sent over the wire that I run out of because so much data is sent over the wire that I run out of
buffer in my terminal window. These are a side-effect of buffer in my terminal window. These are a side-effect of
garray_redraw, as well as the garray_resize branch above. (And garray_redraw, as well as the garray_resize branch above. (And
don't forget that the canvas dialog callback probably causes don't forget that the canvas dialog callback causes some
as many redraws as well.) of these.)
Until the Pd codebase handles redrawing in a sane fashion, Until the Pd codebase handles redrawing in a sane fashion,
without depending on a vast array of side-effects, there's without depending on a vast array of side-effects, there's
......
...@@ -180,7 +180,7 @@ struct _glist ...@@ -180,7 +180,7 @@ struct _glist
struct _glist *gl_owner; /* parent glist, supercanvas, or 0 if none */ struct _glist *gl_owner; /* parent glist, supercanvas, or 0 if none */
int gl_pixwidth; /* width in pixels (on parent, if a graph) */ int gl_pixwidth; /* width in pixels (on parent, if a graph) */
int gl_pixheight; int gl_pixheight;
t_float gl_x1; /* bounding rectangle in our own coordinates */ t_float gl_x1; /* bounding rectangle in our own coordinates */
t_float gl_y1; t_float gl_y1;
t_float gl_x2; t_float gl_x2;
t_float gl_y2; t_float gl_y2;
......
...@@ -310,11 +310,14 @@ void canvas_howputnew(t_canvas *x, int *connectp, int *xpixp, int *ypixp, ...@@ -310,11 +310,14 @@ void canvas_howputnew(t_canvas *x, int *connectp, int *xpixp, int *ypixp,
{ {
t_gobj *g, *selected = x->gl_editor->e_selection->sel_what; t_gobj *g, *selected = x->gl_editor->e_selection->sel_what;
t_text *t = (t_text *)selected; t_text *t = (t_text *)selected;
// if selected object has not yet been activated we need to recreate it first // if selected object has not yet been activated we need to
// recreate it first
if (pd_class(&t->te_pd) == text_class && t->te_type != T_TEXT) if (pd_class(&t->te_pd) == text_class && t->te_type != T_TEXT)
{ {
glist_noselect(x); // we do this to explicitly activate object // we do this to explicitly activate object...
glist_select(x, glist_nth(x, glist_getindex(x, 0)-1)); // then reselect it glist_noselect(x);
// then reselect it
glist_select(x, glist_nth(x, glist_getindex(x, 0)-1));
selected = x->gl_editor->e_selection->sel_what; selected = x->gl_editor->e_selection->sel_what;
} }
for (g = x->gl_list, nobj = 0; g; g = g->g_next, nobj++) for (g = x->gl_list, nobj = 0; g; g = g->g_next, nobj++)
......
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