From 185fd2845a9d61058b9493ef1a6e7d368ebc4e93 Mon Sep 17 00:00:00 2001
From: Ivica Ico Bukvic <ico@vt.edu>
Date: Tue, 9 Sep 2014 14:47:00 -0400
Subject: [PATCH] *fixed regression where g_mycanvas does not resize its select
 area when the mycanvas size is smaller than the select area

---
 pd/src/g_mycanvas.c      | 12 ++++++++++++
 pd/src/pd-l2ork-TODO.txt |  1 -
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/pd/src/g_mycanvas.c b/pd/src/g_mycanvas.c
index a4b93c2d4..bd05bd5e6 100644
--- a/pd/src/g_mycanvas.c
+++ b/pd/src/g_mycanvas.c
@@ -81,6 +81,18 @@ static void my_canvas__clickhook(t_scalehandle *sh, int newstate)
             x->x_vis_h += sh->h_dragy;
             canvas_dirty(x->x_gui.x_glist, 1);
         }
+        // if select area is larger tahn the visible arae
+        // make select area match that of the dragged one
+        // so that we don't have to go into properties to 
+        // manually adjust this
+        if (x->x_vis_w < x->x_gui.x_w)
+            x->x_gui.x_w = x->x_vis_w;
+        if (x->x_vis_h < x->x_gui.x_h)
+            x->x_gui.x_h = x->x_vis_h;
+        if (x->x_gui.x_w < x->x_gui.x_h)
+            x->x_gui.x_h = x->x_gui.x_w;
+        else
+            x->x_gui.x_w = x->x_gui.x_h;
         if (glist_isvisible(x->x_gui.x_glist))
         {
             my_canvas_draw_move(x, x->x_gui.x_glist);
diff --git a/pd/src/pd-l2ork-TODO.txt b/pd/src/pd-l2ork-TODO.txt
index d1232e133..ac5d06e8f 100644
--- a/pd/src/pd-l2ork-TODO.txt
+++ b/pd/src/pd-l2ork-TODO.txt
@@ -1,6 +1,5 @@
 C:
 *messages should be aware of $0?
-*g_mycanvas does not resize its select area when the mycanvas size is smaller than the select area
 
 *verbosity level for the console
 *Draw SECONDARY redrect on gop scalar patchers to reflect the viewport?
-- 
GitLab