Commit 05212d63 authored by Miller Puckette's avatar Miller Puckette
Browse files

clicks preferentially fall on a selected box if there's a

multiple selection.  Fixed 2-pixel growth problem on Mac.
Made a "version" message so Pd can detect future file formats
if they ever appear.
parent 4f257df8
......@@ -1044,18 +1044,21 @@ void canvas_loadbang(t_canvas *x)
/* When you ask a canvas its size the result is 2 pixels more than what
you gave it to open it; perhaps there's a 1-pixel border all around it
or something. Anyway, we just add the 2 pixels back here; seems we
have to do this for linux but not MSW; not sure about MacOS. */
/* When you ask a canvas its size the result is more than what
you gave it to open it; how much bigger apparently depends on the OS. */
#ifdef __unix__
#define VERTBORDER 2
#ifdef MACOSX
#define VERTBORDER 6
#define VERTBORDER 4
static void canvas_relocate(t_canvas *x, t_symbol *canvasgeom,
t_symbol *topgeom)
......@@ -792,6 +792,17 @@ static t_gobj *canvas_findhitbox(t_canvas *x, int xpos, int ypos,
if (canvas_hitbox(x, y, xpos, ypos, &x1, &y1, &x2, &y2)
&& (x1 > *x1p))
*x1p = x1, *y1p = y1, *x2p = x2, *y2p = y2, rval = y;
/* if there are at least two selected objects, we'd prefer
to find a selected one (never mind which) to the one we got. */
if (x->gl_editor && x->gl_editor->e_selection &&
x->gl_editor->e_selection->sel_next && !glist_isselected(x, y))
t_selection *sel;
for (sel = x->gl_editor->e_selection; sel; sel = sel->sel_next)
if (canvas_hitbox(x, sel->sel_what, xpos, ypos, &x1, &y1, &x2, &y2))
*x1p = x1, *y1p = y1, *x2p = x2, *y2p = y2,
rval = sel->sel_what;
return (rval);
......@@ -49,6 +49,12 @@ void glob_foo(void *dummy, t_symbol *s, int argc, t_atom *argv)
static void glob_version(t_pd *dummy, float f)
if (f > 0)
error("file format newer than this version of Pd (trying anyway...)");
void max_default(t_pd *x, t_symbol *s, int argc, t_atom *argv)
int i;
......@@ -113,6 +119,8 @@ void glob_init(void)
class_addmethod(glob_pdobject, (t_method)glob_ping, gensym("ping"), 0);
class_addmethod(glob_pdobject, (t_method)glob_savepreferences,
gensym("save-preferences"), 0);
class_addmethod(glob_pdobject, (t_method)glob_version,
gensym("version"), A_FLOAT, 0);
#ifdef UNIX
class_addmethod(glob_pdobject, (t_method)glob_watchdog,
gensym("watchdog"), 0);
......@@ -2,6 +2,9 @@
fixed crash bug closing patches with open GOPs
fixed PC device counting problem (first device invoked by -audiodev 0)
fixed MSTACKSIZE limitation in m_binbuf.c
fixed so that if more than one object is selected, clicking prefers to
"hit" a selected one (better dragging after "duplicate")
compile on various versions of linux
......@@ -53,7 +56,6 @@ real-time spectrum grapher
document ||, |, etc, better
clicking to prefer selected object if nselect > 1
flag to prevent unlocking patches
clickless connection (hit 'c' key? see Bouchard paper)
messages to suppress menus&accelerators, and invisibilize Pd window
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