From e00c1133cf4f1b2594b6cffe3fbca05764b917fd Mon Sep 17 00:00:00 2001
From: Ivica Ico Bukvic <ico@vt.edu>
Date: Wed, 5 Mar 2014 11:33:56 -0500
Subject: [PATCH] added dynamic getscroll call whenever a scalar is altered to
 ensure proper updating of the srollbars

---
 pd/src/g_scalar.c   |  1 +
 pd/src/g_template.c | 11 +++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/pd/src/g_scalar.c b/pd/src/g_scalar.c
index 389e5a5ec..b18ccf6b6 100644
--- a/pd/src/g_scalar.c
+++ b/pd/src/g_scalar.c
@@ -575,6 +575,7 @@ static void scalar_doredraw(t_gobj *client, t_glist *glist)
 		//fprintf(stderr,"yes\n");
 		sys_vgui("pdtk_select_all_gop_widgets .x%lx %lx %d\n", glist_getcanvas(glist), glist, 1);
 	}
+    sys_vgui("pdtk_canvas_getscroll .x%lx.c\n", glist);
 }
 
 void scalar_redraw(t_scalar *x, t_glist *glist)
diff --git a/pd/src/g_template.c b/pd/src/g_template.c
index 9610cfe83..f539941f3 100644
--- a/pd/src/g_template.c
+++ b/pd/src/g_template.c
@@ -1342,9 +1342,12 @@ void draw_doupdate(t_draw *x, t_canvas *c, t_symbol *s)
                    visible, x, data, str);
             }
         }
-        if (g->g_pd == canvas_class)
+        if (g->g_pd == canvas_class) {
             draw_doupdate(x, (t_glist *)g, s);
+            sys_vgui("pdtk_canvas_getscroll .x%lx.c\n", (t_glist *)g);
+        }
     }
+    sys_vgui("pdtk_canvas_getscroll .x%lx.c\n", c);
 }
 
 extern t_canvas *canvas_list;
@@ -1353,6 +1356,7 @@ void draw_update(t_draw *x, t_symbol *s)
     t_canvas *c;
     for (c = canvas_list; c; c = c->gl_next)
         draw_doupdate(x, c, s);
+
 }
 
 void draw_fillopacity(t_draw *x, t_symbol *s, t_int argc, t_atom *argv)
@@ -1756,9 +1760,12 @@ void draw_doupdatetransform(t_draw *x, t_canvas *c)
                 scalar_drawselectrect((t_scalar *)g, c, 1);
             }
         }
-        if (g->g_pd == canvas_class)
+        if (g->g_pd == canvas_class) {
             draw_doupdatetransform(x, (t_glist *)g);
+            sys_vgui("pdtk_canvas_getscroll .x%lx.c\n", (t_glist *)g);
+        }
     }
+    sys_vgui("pdtk_canvas_getscroll .x%lx.c\n", c);
 }
 
 void draw_queueupdatetransform(t_gobj *g, t_glist *glist)
-- 
GitLab