From 44e10d00ec93cfd30b0748180139c7974daf5274 Mon Sep 17 00:00:00 2001
From: Ivica Ico Bukvic <ico@vt.edu>
Date: Sat, 16 Aug 2014 17:15:46 -0400
Subject: [PATCH] *fixed handle behavior on iemguis (current implementation is
 not equipped to deal with config kind of actions, and it does not have to)
 *streamlined GOP handles since now draw_select deals with explicit delete
 before redraw

---
 pd/src/g_all_guis.c | 4 ++++
 pd/src/g_canvas.c   | 5 -----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/pd/src/g_all_guis.c b/pd/src/g_all_guis.c
index ed0bdb28c..62d3e6c71 100644
--- a/pd/src/g_all_guis.c
+++ b/pd/src/g_all_guis.c
@@ -657,6 +657,8 @@ void scalehandle_draw_select(t_scalehandle *h, t_glist *canvas, int px, int py)
     int sx = h->h_scale ? SCALEHANDLE_WIDTH  : LABELHANDLE_WIDTH;
     int sy = h->h_scale ? SCALEHANDLE_HEIGHT : LABELHANDLE_HEIGHT;
 
+    scalehandle_draw_erase(h,canvas);
+
     if (!h->h_vis) {
         sys_vgui("canvas %s -width %d -height %d -bg $pd_colors(selection) -bd 0 "
             "-cursor %s\n", h->h_pathname, sx, sy, cursor);
@@ -672,9 +674,11 @@ void scalehandle_draw_select(t_scalehandle *h, t_glist *canvas, int px, int py)
             h->h_pathname, tags);
         scalehandle_bind(h);
         h->h_vis = 1;
+    /* not yet (this is not supported by current implementation)
     } else {
         sys_vgui(".x%x.c coords %s %d %d\n", canvas, h->h_pathname,
             x->x_obj.te_xpix+px-sx, x->x_obj.te_ypix+py-sy);
+        sys_vgui("raise %s\n", h->h_pathname); */
     }
 }
 
diff --git a/pd/src/g_canvas.c b/pd/src/g_canvas.c
index 01ff0014e..bffd220d9 100644
--- a/pd/src/g_canvas.c
+++ b/pd/src/g_canvas.c
@@ -711,11 +711,6 @@ void canvas_draw_gop_resize_hooks(t_canvas* x)
         sprintf(sh->h_pathname, ".x%lx.h%lx", (t_int)x, (t_int)sh);
         sprintf(mh->h_pathname, ".x%lx.h%lx", (t_int)x, (t_int)mh);
 
-        // Need to reset handles' vis values because they are erased via map
-        // (when applying properties, for instance)
-        scalehandle_draw_erase(sh,x);
-        scalehandle_draw_erase(mh,x);
-
         scalehandle_draw_select(sh,x,
             -1-x->gl_obj.te_xpix+x->gl_xmargin + x->gl_pixwidth,
             -1-x->gl_obj.te_ypix+x->gl_ymargin + x->gl_pixheight/*,GOP_resblob*/);
-- 
GitLab