Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3308
Modified Files: Tag: devel_0_39 desire.c Log Message: .
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.149 retrieving revision 1.1.2.150 diff -C2 -d -r1.1.2.149 -r1.1.2.150 *** desire.c 6 Sep 2006 00:16:03 -0000 1.1.2.149 --- desire.c 7 Sep 2006 00:00:43 -0000 1.1.2.150 *************** *** 2796,2809 ****
static void graph_xticks(t_glist *x, t_floatarg point, t_floatarg inc, t_floatarg f) { ! x->gl_xtick.k_point = point; ! x->gl_xtick.k_inc = inc; ! x->gl_xtick.k_lperb = f; glist_redraw(x); } - static void graph_yticks(t_glist *x, t_floatarg point, t_floatarg inc, t_floatarg f) { ! x->gl_ytick.k_point = point; ! x->gl_ytick.k_inc = inc; ! x->gl_ytick.k_lperb = f; glist_redraw(x); } --- 2796,2806 ----
static void graph_xticks(t_glist *x, t_floatarg point, t_floatarg inc, t_floatarg f) { ! t_tick *t = &x->gl_xtick; ! t->point = point; t->inc = inc; t->lperb = f; glist_redraw(x); } static void graph_yticks(t_glist *x, t_floatarg point, t_floatarg inc, t_floatarg f) { ! t_tick *t = &x->gl_ytick; ! t->point = point; t->inc = inc; t->lperb = f; glist_redraw(x); } *************** *** 2815,2819 **** argv++; argc--; x->gl_xlabel = (t_symbol **)t_resizebytes(x->gl_xlabel, ! x->gl_nxlabels * sizeof (t_symbol *), argc * sizeof (t_symbol *)); x->gl_nxlabels = argc; for (i = 0; i < argc; i++) x->gl_xlabel[i] = atom_gensym(&argv[i]); --- 2812,2816 ---- argv++; argc--; x->gl_xlabel = (t_symbol **)t_resizebytes(x->gl_xlabel, ! x->gl_nxlabels*sizeof(t_symbol *), argc*sizeof(t_symbol *)); x->gl_nxlabels = argc; for (i = 0; i < argc; i++) x->gl_xlabel[i] = atom_gensym(&argv[i]); *************** *** 2827,2831 **** argv++; argc--; x->gl_ylabel = (t_symbol **)t_resizebytes(x->gl_ylabel, ! x->gl_nylabels * sizeof (t_symbol *), argc * sizeof (t_symbol *)); x->gl_nylabels = argc; for (i = 0; i < argc; i++) x->gl_ylabel[i] = atom_gensym(&argv[i]); --- 2824,2828 ---- argv++; argc--; x->gl_ylabel = (t_symbol **)t_resizebytes(x->gl_ylabel, ! x->gl_nylabels*sizeof(t_symbol *), argc*sizeof(t_symbol *)); x->gl_nylabels = argc; for (i = 0; i < argc; i++) x->gl_ylabel[i] = atom_gensym(&argv[i]); *************** *** 2967,2983 **** } /* draw ticks on horizontal borders. If lperb field is zero, this is disabled. */ ! if (x->gl_xtick.k_lperb) { float upix, lpix; if (y2 < y1) upix = y1, lpix = y2; else upix = y2, lpix = y1; ! for (i = 0, f = x->gl_xtick.k_point; f < 0.99 * x->gl_x2 + 0.01*x->gl_x1; i++, f += x->gl_xtick.k_inc) { ! int tickpix = i%x->gl_xtick.k_lperb ? 2 : 4; int x0 = glist_xtopixels(x, f); sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n", (long)c, x0, (int)upix, x0, (int)(upix-tickpix), tag); sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n", (long)c, x0, (int)lpix, x0, (int)(lpix+tickpix), tag); } ! for (i = 1, f = x->gl_xtick.k_point - x->gl_xtick.k_inc; f > 0.99 * x->gl_x1 + 0.01*x->gl_x2; i++, f -= x->gl_xtick.k_inc) { ! int tickpix = i%x->gl_xtick.k_lperb ? 2 : 4; int x0 = glist_xtopixels(x, f); sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n", (long)c, x0, (int)upix, x0, (int)(upix-tickpix), tag); --- 2964,2980 ---- } /* draw ticks on horizontal borders. If lperb field is zero, this is disabled. */ ! if (x->gl_xtick.lperb) { float upix, lpix; if (y2 < y1) upix = y1, lpix = y2; else upix = y2, lpix = y1; ! for (i=0,f=x->gl_xtick.point; f<0.99*x->gl_x2+0.01*x->gl_x1; i++, f+=x->gl_xtick.inc) { ! int tickpix = i%x->gl_xtick.lperb ? 2 : 4; int x0 = glist_xtopixels(x, f); sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n", (long)c, x0, (int)upix, x0, (int)(upix-tickpix), tag); sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n", (long)c, x0, (int)lpix, x0, (int)(lpix+tickpix), tag); } ! for (i=1,f=x->gl_xtick.point-x->gl_xtick.inc; f>0.99*x->gl_x1+0.01*x->gl_x2; i++,f-=x->gl_xtick.inc) { ! int tickpix = i%x->gl_xtick.lperb ? 2 : 4; int x0 = glist_xtopixels(x, f); sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n", (long)c, x0, (int)upix, x0, (int)(upix-tickpix), tag); *************** *** 2987,3003 ****
/* draw ticks in vertical borders*/ ! if (x->gl_ytick.k_lperb) { float ubound, lbound; if (x->gl_y2 < x->gl_y1) ubound = x->gl_y1, lbound = x->gl_y2; else ubound = x->gl_y2, lbound = x->gl_y1; ! for (i = 0, f = x->gl_ytick.k_point; f < 0.99 * ubound + 0.01 * lbound; i++, f += x->gl_ytick.k_inc) { ! int tickpix = i%x->gl_ytick.k_lperb ? 2 : 4; int y0 = (int)glist_ytopixels(x, f); sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n", (long)c, x1, y0, x1+tickpix, y0, tag); sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n", (long)c, x2, y0, x2-tickpix, y0, tag); } ! for (i = 1, f = x->gl_ytick.k_point - x->gl_ytick.k_inc; f > 0.99 * lbound + 0.01 * ubound; i++, f -= x->gl_ytick.k_inc) { ! int tickpix = i%x->gl_ytick.k_lperb ? 2 : 4; int y0 = (int)glist_ytopixels(x, f); sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n", (long)c, x1, y0, x1+tickpix, y0, tag); --- 2984,3000 ----
/* draw ticks in vertical borders*/ ! if (x->gl_ytick.lperb) { float ubound, lbound; if (x->gl_y2 < x->gl_y1) ubound = x->gl_y1, lbound = x->gl_y2; else ubound = x->gl_y2, lbound = x->gl_y1; ! for (i=0,f=x->gl_ytick.point; f<0.99*ubound+0.01*lbound; i++, f += x->gl_ytick.inc) { ! int tickpix = i%x->gl_ytick.lperb ? 2 : 4; int y0 = (int)glist_ytopixels(x, f); sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n", (long)c, x1, y0, x1+tickpix, y0, tag); sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n", (long)c, x2, y0, x2-tickpix, y0, tag); } ! for (i=1,f=x->gl_ytick.point-x->gl_ytick.inc; f>0.99*lbound+0.01*ubound; i++,f-=x->gl_ytick.inc) { ! int tickpix = i%x->gl_ytick.lperb ? 2 : 4; int y0 = (int)glist_ytopixels(x, f); sys_vgui(".x%lx.c create line %d %d %d %d -tags %s\n", (long)c, x1, y0, x1+tickpix, y0, tag); *************** *** 3050,3061 **** graph_lastypix = newypix; // verify that the array is OK ! if (!a || pd_class((t_pd *)a) != garray_class) ! return; ! if (!garray_getfloatarray(a, &nelem, &vec)) ! return; ! if (oldx < 0) oldx = 0; ! if (oldx >= nelem) oldx = nelem - 1; ! if (newx < 0) newx = 0; ! if (newx >= nelem) newx = nelem - 1; if (oldx < newx - 1) { for (i = oldx + 1; i <= newx; i++) --- 3047,3054 ---- graph_lastypix = newypix; // verify that the array is OK ! if (!a || pd_class((t_pd *)a) != garray_class) return; ! if (!garray_getfloatarray(a, &nelem, &vec)) return; ! if (oldx < 0) oldx = 0; else if (oldx >= nelem) oldx = nelem - 1; ! if (newx < 0) newx = 0; else if (newx >= nelem) newx = nelem - 1; if (oldx < newx - 1) { for (i = oldx + 1; i <= newx; i++)