From f1fe3e6ec895975207d95eef3f9244970522dd7a Mon Sep 17 00:00:00 2001 From: Ivica Ico Bukvic <ico@vt.edu> Date: Sat, 16 Aug 2014 16:53:54 -0400 Subject: [PATCH] *fixed GOP scale/move handle regressions (discovered a few more inconsistencies with number box). --- pd/src/g_all_guis.c | 4 +++- pd/src/g_canvas.c | 11 +++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pd/src/g_all_guis.c b/pd/src/g_all_guis.c index 4a9a926c0..ed0bdb28c 100644 --- a/pd/src/g_all_guis.c +++ b/pd/src/g_all_guis.c @@ -699,7 +699,9 @@ void scalehandle_draw_select2(t_iemgui *x, t_glist *canvas) { void scalehandle_draw_erase(t_scalehandle *h, t_glist *canvas) { if (!h->h_vis) return; sys_vgui("destroy %s\n", h->h_pathname); - sys_vgui(".x%lx.c delete %lx%s\n", canvas, h->h_master, h->h_scale ? "SCALE" : "LABELH"); + sys_vgui(".x%lx.c delete %lx%s\n", canvas, h->h_master, + h->h_scale ? "SCALE" : pd_class((t_pd *)h->h_master)==canvas_class?"MOVE":"LABELH"); + h->h_vis = 0; } void scalehandle_draw_erase2(t_iemgui *x, t_glist *canvas) { diff --git a/pd/src/g_canvas.c b/pd/src/g_canvas.c index 040ab1212..01ff0014e 100644 --- a/pd/src/g_canvas.c +++ b/pd/src/g_canvas.c @@ -699,17 +699,23 @@ void canvas_draw_gop_resize_hooks(t_canvas* x) { t_scalehandle *sh = (t_scalehandle *)(x->x_handle); t_scalehandle *mh = (t_scalehandle *)(x->x_mhandle); + //fprintf(stderr,"draw_gop_resize_hooks START\n"); //in case we are an array which does not initialize its hooks if (!sh || !mh) return; if(x->gl_edit && glist_isvisible(x) && glist_istoplevel(x) && x->gl_goprect && !x->gl_editor->e_selection) { //Drawing and Binding Resize_Blob for GOP - //fprintf(stderr,"draw_gop_resize_hooks %lx %lx\n", + //fprintf(stderr,"draw_gop_resize_hooks DRAW %lx %lx\n", // (t_int)x, (t_int)glist_getcanvas(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*/); @@ -719,6 +725,7 @@ void canvas_draw_gop_resize_hooks(t_canvas* x) } else { + //fprintf(stderr,"draw_gop_resize_hooks ERASE\n"); scalehandle_draw_erase(sh,x); scalehandle_draw_erase(mh,x); } @@ -2005,7 +2012,7 @@ void canvasgop__clickhook(t_scalehandle *sh, t_floatarg f, t_floatarg xxx, t_flo //scalehandle_draw_erase(sh,x); sys_vgui("lower %s\n", sh->h_pathname); //delete GOP_resblob when moving the whole GOP - sys_vgui(".x%lx.c delete GOP_resblob \n", x); + sys_vgui(".x%lx.c delete %lxSCALE\n", x, x); } sh->h_dragx = 0; sh->h_dragy = 0; -- GitLab