From ae2d5df7db6fe94c066a6f16505657d9b9cb641a Mon Sep 17 00:00:00 2001
From: Ivica Ico Bukvic <ico@vt.edu>
Date: Mon, 9 Dec 2013 17:35:47 -0500
Subject: [PATCH] *forced hidetext on all gop arrays to make its resizing sane.
 Later update properties to reflect lack of this option.

---
 pd/src/g_canvas.c | 11 ++++++++++-
 pd/src/g_editor.c | 13 +++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/pd/src/g_canvas.c b/pd/src/g_canvas.c
index 5318a21e9..1b2ca8b6f 100644
--- a/pd/src/g_canvas.c
+++ b/pd/src/g_canvas.c
@@ -592,7 +592,16 @@ void glist_glist(t_glist *g, t_symbol *s, int argc, t_atom *argv)
     otherwise it appears as a text box. */
 int glist_isgraph(t_glist *x)
 {
-  return (x->gl_isgraph|(x->gl_hidetext<<1));
+    // testing to see if we have an array and force hiding text (later update GUI accordingly)
+    t_gobj *g = x->gl_list;
+    int hasarray = 0;
+    while (g) {
+        if (pd_class(&g->g_pd) == garray_class) hasarray = 1;
+        g = g->g_next;
+    }
+    if (hasarray && x->gl_isgraph && !x->gl_hidetext)
+        x->gl_hidetext = 1;
+    return (x->gl_isgraph|(x->gl_hidetext<<1));
 }
 
     /* This is sent from the GUI to inform a toplevel that its window has been
diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c
index 2a70a0b6d..725fd9f48 100644
--- a/pd/src/g_editor.c
+++ b/pd/src/g_editor.c
@@ -2370,6 +2370,19 @@ void canvas_setgraph(t_glist *x, int flag, int nogoprect)
 		}
         x->gl_isgraph = 1;
         x->gl_hidetext = !(!(flag&2));
+        
+
+        // check if we have array inside GOP, if so, make sure hidetext is always hidden no matter what
+        t_gobj *g = x->gl_list;
+        int hasarray = 0;
+        while (g) {
+        	if (pd_class(&g->g_pd) == garray_class) hasarray = 1;
+        	g = g->g_next;
+        }
+        if (hasarray)
+        	x->gl_hidetext = 1;
+
+
         if (!nogoprect && !x->gl_goprect)
         {
 			/* Ivica Ico Bukvic 5/16/10 <ico@bukvic.net> */
-- 
GitLab