The attached patch fixes following bugs in both extended and vanilla
0.42.5 Pd:

*hidetext GOP property not being saved properly with the patch
*stale object drawn when gop is turned off while gop-ed patcher is open
*random crashes that result from the former misbehavior
*gop-ed patchers now save properties to the saved file using the new gop
format (as defined in the g_readwrite.c), rather than old pre-0.38
format

Synopsis:
Basically x->gl_goprect = 1; in g_editor.c is never reached when the
gop-ed patcher has no elements in it. Added if statement checks if
g_list is empty and adjusts accordingly.

Cheers!

Ico

--- g_editor.c.old	2010-05-16 20:45:52.000000000 -0400
+++ g_editor.c	2010-05-16 20:44:01.000000000 -0400
@@ -1040,12 +1040,26 @@
         if (!nogoprect && !x->gl_goprect)
         {
             t_gobj *g;
-            for (g = x->gl_list; g; g = g->g_next)
-                if (pd_checkobject(&g->g_pd))
-            {
+            for (g = x->gl_list; g; g = g->g_next) {
+                if (pd_checkobject(&g->g_pd) != 0)
+            	{
+                	x->gl_goprect = 1;
+                	break;
+            	}
+			}
+			/* Ivica Ico Bukvic 5/16/10 <i...@bukvic.net>
+			   no object exists on child GOP so the for loop above
+			   never reaches anything, yet we still need to set
+			   goprect to 1 te get the new style of saving GOP and
+			   thus retaining hidetext value properly 
+
+			   This also solves the bug where turning off GOP can
+			   leave stale objects that are drawn on parent's canvas
+			   where GOP rectangle (and them inside it) used to be
+			*/
+			if (!g) {
                 x->gl_goprect = 1;
-                break;
-            }
+			}
         }
         if (glist_isvisible(x) && x->gl_goprect)
             glist_redraw(x);
_______________________________________________
Pd-dev mailing list
Pd-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev

Reply via email to