aboutsummaryrefslogtreecommitdiff
path: root/pd/src/g_canvas.c
diff options
context:
space:
mode:
Diffstat (limited to 'pd/src/g_canvas.c')
-rw-r--r--pd/src/g_canvas.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/pd/src/g_canvas.c b/pd/src/g_canvas.c
index 10f897c1..36d3d3d6 100644
--- a/pd/src/g_canvas.c
+++ b/pd/src/g_canvas.c
@@ -448,8 +448,8 @@ static void canvas_coords(t_glist *x, t_symbol *s, int argc, t_atom *argv)
/* make a new glist and add it to this glist. It will appear as
a "graph", not a text object. */
t_glist *glist_addglist(t_glist *g, t_symbol *sym,
- float x1, float y1, float x2, float y2,
- float px1, float py1, float px2, float py2)
+ t_float x1, t_float y1, t_float x2, t_float y2,
+ t_float px1, t_float py1, t_float px2, t_float py2)
{
static int gcount = 0;
int zz;
@@ -474,7 +474,7 @@ t_glist *glist_addglist(t_glist *g, t_symbol *sym,
that is higher on the screen. */
if (py2 < py1)
{
- float zz;
+ t_float zz;
zz = y2;
y2 = y1;
y1 = zz;
@@ -520,14 +520,14 @@ t_glist *glist_addglist(t_glist *g, t_symbol *sym,
void glist_glist(t_glist *g, t_symbol *s, int argc, t_atom *argv)
{
t_symbol *sym = atom_getsymbolarg(0, argc, argv);
- float x1 = atom_getfloatarg(1, argc, argv);
- float y1 = atom_getfloatarg(2, argc, argv);
- float x2 = atom_getfloatarg(3, argc, argv);
- float y2 = atom_getfloatarg(4, argc, argv);
- float px1 = atom_getfloatarg(5, argc, argv);
- float py1 = atom_getfloatarg(6, argc, argv);
- float px2 = atom_getfloatarg(7, argc, argv);
- float py2 = atom_getfloatarg(8, argc, argv);
+ t_float x1 = atom_getfloatarg(1, argc, argv);
+ t_float y1 = atom_getfloatarg(2, argc, argv);
+ t_float x2 = atom_getfloatarg(3, argc, argv);
+ t_float y2 = atom_getfloatarg(4, argc, argv);
+ t_float px1 = atom_getfloatarg(5, argc, argv);
+ t_float py1 = atom_getfloatarg(6, argc, argv);
+ t_float px2 = atom_getfloatarg(7, argc, argv);
+ t_float py2 = atom_getfloatarg(8, argc, argv);
glist_addglist(g, sym, x1, y1, x2, y2, px1, py1, px2, py2);
}
@@ -557,7 +557,7 @@ static void canvas_setbounds(t_canvas *x, int x1, int y1, int x2, int y2)
fix so that zero is bottom edge and redraw. This is
only appropriate if we're a regular "text" object on the
parent. */
- float diff = x->gl_y1 - x->gl_y2;
+ t_float diff = x->gl_y1 - x->gl_y2;
t_gobj *y;
x->gl_y1 = heightwas * diff;
x->gl_y2 = x->gl_y1 - diff;
@@ -738,7 +738,7 @@ void canvas_create_editor(t_glist *x, int createit)
}
for (y = x->gl_list; y; y = y->g_next)
if (pd_class(&y->g_pd) == canvas_class &&
- ((t_canvas *)y)->gl_isgraph)
+ ((t_canvas *)y)->gl_isgraph && !((t_canvas *)y)->gl_havewindow)
canvas_create_editor((t_canvas *)y, createit);
}
@@ -808,7 +808,8 @@ void canvas_vis(t_canvas *x, t_floatarg f)
if (glist_isgraph(x) && x->gl_owner)
{
t_glist *gl2 = x->gl_owner;
- canvas_create_editor(x, 1);
+ if (!x->gl_owner->gl_isdeleting)
+ canvas_create_editor(x, 1);
if (glist_isvisible(gl2))
gobj_vis(&x->gl_gobj, gl2, 0);
x->gl_havewindow = 0;
@@ -1043,18 +1044,21 @@ void canvas_loadbang(t_canvas *x)
canvas_loadbangsubpatches(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 HORIZBORDER 2
#define VERTBORDER 2
#else
+#ifdef MACOSX
+#define HORIZBORDER 6
+#define VERTBORDER 6
+#else
#define HORIZBORDER 4
#define VERTBORDER 4
#endif
+#endif
static void canvas_relocate(t_canvas *x, t_symbol *canvasgeom,
t_symbol *topgeom)