Commit 302a88b4 authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

*made startmotion more user-friendly by hiding iemgui's handles after initial...

*made startmotion more user-friendly by hiding iemgui's handles after initial creation until motion is complete. LATER get rid of this because it is likely to be seen as an interim hack due to determinacy issues between the gui and core engine.
parent 8ab70832
......@@ -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);
}
......
......@@ -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 ----------------------- */
......
......@@ -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),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment