From 56a7f78ffb355f8da6bebb881aa69da104c862d0 Mon Sep 17 00:00:00 2001 From: Jonathan Wilkes <jon.w.wilkes@gmail.com> Date: Wed, 6 Jan 2016 00:29:30 -0500 Subject: [PATCH] remove scalehandle_unclick_label, and clean up some formatting --- pd/src/g_all_guis.c | 29 +++-------------------------- pd/src/g_all_guis.h | 1 - pd/src/g_canvas.c | 2 ++ 3 files changed, 5 insertions(+), 27 deletions(-) diff --git a/pd/src/g_all_guis.c b/pd/src/g_all_guis.c index a52a2bdc7..1e715a147 100644 --- a/pd/src/g_all_guis.c +++ b/pd/src/g_all_guis.c @@ -808,7 +808,6 @@ void scalehandle_dragon_label(t_scalehandle *h, float mouse_x, float mouse_y) { h->h_dragx = dx; h->h_dragy = dy; - int properties = gfxstub_haveproperties((void *)x); if (properties) { @@ -817,21 +816,18 @@ void scalehandle_dragon_label(t_scalehandle *h, float mouse_x, float mouse_y) { properties_set_field_int(properties,"label.xy.x_entry",new_x); properties_set_field_int(properties,"label.xy.y_entry",new_y); } - x->x_ldx += dx; x->x_ldy += dy; - - if (glist_isvisible(x->x_glist)) { int xpos=text_xpix(&x->x_obj, x->x_glist); int ypos=text_ypix(&x->x_obj, x->x_glist); //iemgui_getrect_legacy_label(x, &xpos, &ypos); t_canvas *canvas=glist_getcanvas(x->x_glist); - sys_vgui(".x%lx.c coords %lxLABEL %d %d\n", canvas, x, - xpos+x->x_ldx + h->h_dragx, - ypos+x->x_ldy + h->h_dragy); + //sys_vgui(".x%lx.c coords %lxLABEL %d %d\n", canvas, x, + // xpos+x->x_ldx + h->h_dragx, + // ypos+x->x_ldy + h->h_dragy); gui_vmess("gui_iemgui_label_coords", "xxii", canvas, x, @@ -841,23 +837,6 @@ void scalehandle_dragon_label(t_scalehandle *h, float mouse_x, float mouse_y) { } } -void scalehandle_unclick_label(t_scalehandle *h) { - t_iemgui *x = (t_iemgui *)h->h_master; - canvas_apply_setundo(x->x_glist, (t_gobj *)x); - if (h->h_dragx || h->h_dragy) - { - x->x_ldx += h->h_dragx; - x->x_ldy += h->h_dragy; - canvas_dirty(x->x_glist, 1); - } - if (glist_isvisible(x->x_glist)) - { - iemgui_select((t_gobj *)x, x->x_glist, 1); - canvas_fixlinesfor(x->x_glist, (t_text *)x); - canvas_getscroll(x->x_glist); - } -} - void scalehandle_click_label(t_scalehandle *h) { t_iemgui *x = (t_iemgui *)h->h_master; if (glist_isvisible(x->x_glist)) @@ -943,8 +922,6 @@ static void scalehandle_motionhook(t_scalehandle *h, void iemgui__clickhook3(t_scalehandle *sh, int newstate) { if (!sh->h_dragon && newstate && sh->h_scale) scalehandle_click_scale(sh); - else if (sh->h_dragon && newstate == 0 && !sh->h_scale) - scalehandle_unclick_label(sh); else if (!sh->h_dragon && newstate && !sh->h_scale) scalehandle_click_label(sh); sh->h_dragon = newstate; diff --git a/pd/src/g_all_guis.h b/pd/src/g_all_guis.h index d446522fa..81549d3e1 100644 --- a/pd/src/g_all_guis.h +++ b/pd/src/g_all_guis.h @@ -239,7 +239,6 @@ EXTERN t_scalehandle *scalehandle_new(t_object *x, t_glist *glist, int scale, t_ EXTERN void scalehandle_free(t_scalehandle *h); EXTERN void properties_set_field_int(long props, const char *gui_field, int value); EXTERN void scalehandle_dragon_label(t_scalehandle *h, float f1, float f2); -EXTERN void scalehandle_unclick_label(t_scalehandle *h); EXTERN void scalehandle_click_label(t_scalehandle *h); EXTERN void scalehandle_click_scale(t_scalehandle *h); EXTERN void scalehandle_unclick_scale(t_scalehandle *h); diff --git a/pd/src/g_canvas.c b/pd/src/g_canvas.c index e0c5011b1..64a5bb3e1 100644 --- a/pd/src/g_canvas.c +++ b/pd/src/g_canvas.c @@ -2131,6 +2131,8 @@ void canvasgop__clickhook(t_scalehandle *sh, int newstate) } else //enter if move_gop hook {// this block is similar to scalehandle_unclick_label but not enough + // We've actually removed scalehandle_unclick_label everywhere, so + // check to see whether this can be removed as well... canvas_undo_add(x, 8, "apply", canvas_undo_set_canvas(x)); if (sh->h_dragx || sh->h_dragy) { -- GitLab