diff --git a/pd/src/g_all_guis.c b/pd/src/g_all_guis.c index 417a1444b3c76b22687d7da194573d89f5df5644..0cf62ce207cbf795fab9b44269ddd2e66e64d9ce 100644 --- a/pd/src/g_all_guis.c +++ b/pd/src/g_all_guis.c @@ -506,7 +506,20 @@ void iemgui_select(t_gobj *z, t_glist *glist, int selected) sys_vgui(".x%lx.c itemconfigure {x%lx&&border} -stroke %s\n", canvas, x, x->x_selected && x->x_glist == canvas ? selection_color : fcol); x->x_draw((void *)z, glist, IEM_GUI_DRAW_MODE_SELECT); - scalehandle_draw(x); + if (selected < 2) + { + scalehandle_draw(x); + } + else + { + // exception where we get rid of handles when moving tiny objects + // because tkpath's slowness sometimes makes mouse pointer go over + // a handle and messes things up. we only do this when using + // startmotion (see g_editor.c). + // LATER: get rid of this because we will deal with this better using + // the new toolkit. + scalehandle_draw_erase2(x); + } iemgui_label_draw_select(x); iemgui_tag_selected(x); } diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c index a896c623b22be426ccc0a3c493acdc12008db0e6..8dccf5fea770ce29a7001527bc25d2f9dbd88508 100644 --- a/pd/src/g_editor.c +++ b/pd/src/g_editor.c @@ -3073,6 +3073,18 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, if (x->gl_editor->e_onmotion == MA_MOVE) { //fprintf(stderr,"letting go of objects\n"); + t_selection *sel; + for (sel = x->gl_editor->e_selection; sel; sel = sel->sel_next) + { + if (sel && ((t_text *)sel->sel_what)->te_iemgui) + { + // iemgui exception to hide all handles that may interfere + // with the mouse cursor and its ability to move/deselect + // object(s) in question. Here we reinstate them once we've + // let go of the object(s) + gobj_select(sel->sel_what, x, 1); + } + } canvas_raise_all_cords(x); scrollbar_update(x); } @@ -5128,6 +5140,17 @@ void canvas_startmotion(t_canvas *x) x->gl_editor->e_onmotion = MA_MOVE; x->gl_editor->e_xwas = xval; x->gl_editor->e_ywas = yval; + t_selection *sel; + for (sel = x->gl_editor->e_selection; sel; sel = sel->sel_next) + { + if (sel && ((t_text *)sel->sel_what)->te_iemgui) + { + // iemgui exception to hide all handles that may interfere + // with the mouse cursor and its ability to move/deselect + // object(s) in question + gobj_select(sel->sel_what, x, 2); + } + } } /* ----------------------------- window stuff ----------------------- */ diff --git a/pd/src/g_text.c b/pd/src/g_text.c index d01da0d3a20d2ab2426ca6ee26e198138a4a0de5..06fdf4937e8d618ee9f3e03b8a2572494b146f13 100644 --- a/pd/src/g_text.c +++ b/pd/src/g_text.c @@ -102,7 +102,7 @@ void glist_text(t_glist *gl, t_symbol *s, int argc, t_atom *argv) (void *)canvas_undo_set_create(glist_getcanvas(gl))); if (connectme == 0) { - canvas_displaceselection(glist_getcanvas(gl), 5, -7); + canvas_displaceselection(glist_getcanvas(gl), -8, -8); canvas_startmotion(glist_getcanvas(gl)); } } @@ -352,7 +352,7 @@ void canvas_obj(t_glist *gl, t_symbol *s, int argc, t_atom *argv) else if (connectme == 0) { //fprintf(stderr,"canvas_obj calls canvas_startmotion\n"); - canvas_displaceselection(glist_getcanvas(gl), 5, -7); + canvas_displaceselection(glist_getcanvas(gl), -8, -8); canvas_startmotion(glist_getcanvas(gl)); } //canvas_setundo(glist_getcanvas(gl), @@ -452,7 +452,7 @@ void canvas_iemguis(t_glist *gl, t_symbol *guiobjname) //canvas_objtext(gl, xpix, ypix, 1, b); else if (connectme == 0) { - canvas_displaceselection(glist_getcanvas(gl), 5, -7); + canvas_displaceselection(glist_getcanvas(gl), -8, -8); canvas_startmotion(glist_getcanvas(gl)); } //canvas_setundo(glist_getcanvas(gl), @@ -775,7 +775,7 @@ void canvas_msg(t_glist *gl, t_symbol *s, int argc, t_atom *argv) canvas_connect(gl, indx, 0, nobj, 0); else if (connectme == 0) { - canvas_displaceselection(glist_getcanvas(gl), 5, -7); + canvas_displaceselection(glist_getcanvas(gl), -8, -8); canvas_startmotion(glist_getcanvas(gl)); } //canvas_setundo(glist_getcanvas(gl), @@ -1274,7 +1274,7 @@ void canvas_atom(t_glist *gl, t_atomtype type, canvas_connect(gl, indx, 0, nobj, 0); else if (connectme == 0) { - canvas_displaceselection(glist_getcanvas(gl), 5, -7); + canvas_displaceselection(glist_getcanvas(gl), -8, -8); canvas_startmotion(glist_getcanvas(gl)); } //canvas_setundo(glist_getcanvas(gl),