Rev 8068 | Rev 8102 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8068 | Rev 8076 | ||
---|---|---|---|
Line 17... | Line 17... | ||
17 | 17 | ||
18 | #include <errno.h> |
18 | #include <errno.h> |
19 | /* bug in gdImageFillToBorder */ |
19 | /* bug in gdImageFillToBorder */ |
20 | void gdImageFillToBorder1 (gdImagePtr im, int x, int y, int border, int color) |
20 | void gdImageFillToBorder1 (gdImagePtr im, int x, int y, int border, int color) |
21 | { |
21 | { |
22 | int pp=x; |
- | |
23 | if( |
22 | if(x>=image->sx) x=image->sx-1; if(x<0) x=0; |
24 | if( |
23 | if(y>=image->sy) y=image->sy-1; if(y<0) y=0; |
25 | gdImageFillToBorder(im, |
24 | gdImageFillToBorder(im,x,y,border,color); |
26 | } |
25 | } |
- | 26 | ||
- | 27 | void gdImageFillToBorder2 (gdImagePtr im, int x, int y, int border, int color) |
|
- | 28 | { |
|
- | 29 | if(x>=image->sx || x<0 || y>=image->sy || y<0) return; |
|
- | 30 | gdImageFillToBorder(im,x,y,border,color); |
|
- | 31 | } |
|
- | 32 | ||
27 | 33 | ||
28 | /* File opening: with security */ |
34 | /* File opening: with security */ |
29 | FILE *open4read(char *n) |
35 | FILE *open4read(char *n) |
30 | { |
36 | { |
31 | char *p, *p1, *p2, namebuf[2048]; |
37 | char *p, *p1, *p2, namebuf[2048]; |
Line 370... | Line 376... | ||
370 | scale(pm->pd,pm->p,1); |
376 | scale(pm->pd,pm->p,1); |
371 | pm->p[2]=rint(pm->pd[2]*xscale); pm->p[3]=rint(pm->pd[3]*yscale); |
377 | pm->p[2]=rint(pm->pd[2]*xscale); pm->p[3]=rint(pm->pd[3]*yscale); |
372 | if(pm->fill) { |
378 | if(pm->fill) { |
373 | gdImageArc(image,pm->p[0],pm->p[1],pm->p[2],pm->p[3],0,360, |
379 | gdImageArc(image,pm->p[0],pm->p[1],pm->p[2],pm->p[3],0,360, |
374 | color_bounder); |
380 | color_bounder); |
375 |
|
381 | gdImageFillToBorder2(image,pm->p[0],pm->p[1], |
376 | color_bounder,pm->color[0]); |
382 | color_bounder,pm->color[0]); |
377 | } |
383 | } |
378 | gdImageArc(image,pm->p[0],pm->p[1],pm->p[2],pm->p[3],0,360,pm->color[0]); |
384 | gdImageArc(image,pm->p[0],pm->p[1],pm->p[2],pm->p[3],0,360,pm->color[0]); |
379 | if(vimg_enable) vimg_ellipse(scale_buf[0],scale_buf[1],0.5*pm->pd[2],0.5*pm->pd[3]); |
385 | if(vimg_enable) vimg_ellipse(scale_buf[0],scale_buf[1],0.5*pm->pd[2],0.5*pm->pd[3]); |
380 | } |
386 | } |
Line 385... | Line 391... | ||
385 | scale(pm->pd,pm->p,1); |
391 | scale(pm->pd,pm->p,1); |
386 | pm->p[2]=rint(pm->pd[2]); pm->p[3]=rint(pm->pd[2]); |
392 | pm->p[2]=rint(pm->pd[2]); pm->p[3]=rint(pm->pd[2]); |
387 | if(pm->fill) { |
393 | if(pm->fill) { |
388 | gdImageArc(image,pm->p[0],pm->p[1],pm->p[2],pm->p[3],0,360, |
394 | gdImageArc(image,pm->p[0],pm->p[1],pm->p[2],pm->p[3],0,360, |
389 | color_bounder); |
395 | color_bounder); |
390 |
|
396 | gdImageFillToBorder2(image,pm->p[0],pm->p[1], |
391 | color_bounder,pm->color[0]); |
397 | color_bounder,pm->color[0]); |
392 | } |
398 | } |
393 | gdImageArc(image,pm->p[0],pm->p[1],pm->p[2],pm->p[3],0,360,pm->color[0]); |
399 | gdImageArc(image,pm->p[0],pm->p[1],pm->p[2],pm->p[3],0,360,pm->color[0]); |
394 | } |
400 | } |
395 | 401 | ||
Line 780... | Line 786... | ||
780 | evalue_compile(p1); evalue_compile(p2); |
786 | evalue_compile(p1); evalue_compile(p2); |
781 | if(vimg_enable) vimg_plotstart(); |
787 | if(vimg_enable) vimg_plotstart(); |
782 | for(i=j=0;i<=tstep;i++) { |
788 | for(i=j=0;i<=tstep;i++) { |
783 | if(n==1) { |
789 | if(n==1) { |
784 | if(tranged) t=tstart+i*v; else t=xstart+i*v; |
790 | if(tranged) t=tstart+i*v; else t=xstart+i*v; |
785 | eval_setval(varpos,t); dc[0]=t; dc[1]= |
791 | eval_setval(varpos,t); dc[0]=t; dc[1]=strevalue(p1); |
786 | } |
792 | } |
787 | else { |
793 | else { |
788 | t=tstart+i*v; eval_setval(varpos,t); |
794 | t=tstart+i*v; eval_setval(varpos,t); |
789 | dc[0]= |
795 | dc[0]=strevalue(p1); dc[1]=strevalue(p2); |
790 | } |
796 | } |
791 | if(!finite(dc[0]) || !finite(dc[1])) ic[0]=ic[1]=-BOUND; |
797 | if(!finite(dc[0]) || !finite(dc[1])) ic[0]=ic[1]=-BOUND; |
792 | else scale(dc,ic,1); |
798 | else scale(dc,ic,1); |
793 | if(vimg_enable) vimg_plot1 (scale_buf[0],scale_buf[1]); |
799 | if(vimg_enable) vimg_plot1 (scale_buf[0],scale_buf[1]); |
794 | if(j==0) { |
800 | if(j==0) { |
Line 844... | Line 850... | ||
844 | if(n<=1) {ld->levelcnt=1; ld->levels[0]=0;} |
850 | if(n<=1) {ld->levelcnt=1; ld->levels[0]=0;} |
845 | else { |
851 | else { |
846 | if(n>LEVEL_LIM+1) n=LEVEL_LIM+1; |
852 | if(n>LEVEL_LIM+1) n=LEVEL_LIM+1; |
847 | for(i=0;i<n-1;i++) { |
853 | for(i=0;i<n-1;i++) { |
848 | fnd_item(pm->str,i+2,tc); |
854 | fnd_item(pm->str,i+2,tc); |
849 | d= |
855 | d=strevalue(tc); |
850 | if(finite(d)) ld->levels[i]=d; else ld->levels[i]=0; |
856 | if(finite(d)) ld->levels[i]=d; else ld->levels[i]=0; |
851 | } |
857 | } |
852 | ld->levelcnt=n-1; |
858 | ld->levelcnt=n-1; |
853 | } |
859 | } |
854 | levelcurve(ld); |
860 | levelcurve(ld); |
Line 1189... | Line 1195... | ||
1189 | { |
1195 | { |
1190 | int k, cc[3]; |
1196 | int k, cc[3]; |
1191 | char buf[MAX_LINELEN+1]; |
1197 | char buf[MAX_LINELEN+1]; |
1192 | for(k=0;k<3;k++) { |
1198 | for(k=0;k<3;k++) { |
1193 | fnd_item(p,k+1,buf); |
1199 | fnd_item(p,k+1,buf); |
1194 | cc[k]= |
1200 | cc[k]=strevalue(buf); |
1195 | } |
1201 | } |
1196 | collapse_item(p,3); |
1202 | collapse_item(p,3); |
1197 | if(cc[0]==-1 && cc[1]==-1 && cc[2]==-255) { |
1203 | if(cc[0]==-1 && cc[1]==-1 && cc[2]==-255) { |
1198 | 1204 | ||
1199 | if(brushed && o->subst&1) return gdBrushed; |
1205 | if(brushed && o->subst&1) return gdBrushed; |
Line 1229... | Line 1235... | ||
1229 | } |
1235 | } |
1230 | snprintf(buf,sizeof(buf),"%s",p); |
1236 | snprintf(buf,sizeof(buf),"%s",p); |
1231 | for(j=0, p1=buf; j<pm->pcnt; j++, p1=p2) { |
1237 | for(j=0, p1=buf; j<pm->pcnt; j++, p1=p2) { |
1232 | p2=find_item_end(p1); if(*p2) *p2++=0; |
1238 | p2=find_item_end(p1); if(*p2) *p2++=0; |
1233 | p1=find_word_start(p1); |
1239 | p1=find_word_start(p1); |
1234 | if(*p1) pm->pd[j]= |
1240 | if(*p1) pm->pd[j]=strevalue(p1); else pm->pd[j]=0; |
1235 | if(!finite(pm->pd[j])) { |
1241 | if(!finite(pm->pd[j])) { |
1236 | if(j<o->required_parms) return -1; |
1242 | if(j<o->required_parms) return -1; |
1237 | else {pm->pd[j]=0;break;} |
1243 | else {pm->pd[j]=0;break;} |
1238 | } |
1244 | } |
1239 | } |
1245 | } |
Line 1269... | Line 1275... | ||
1269 | pp=find_word_end(p); |
1275 | pp=find_word_end(p); |
1270 | if(*pp!=0) { |
1276 | if(*pp!=0) { |
1271 | *(pp++)=0; pp=find_word_start(pp); |
1277 | *(pp++)=0; pp=find_word_start(pp); |
1272 | } |
1278 | } |
1273 | if(strlen(p)==1 || (strlen(p)==2 && isdigit(*(p+1)))) { |
1279 | if(strlen(p)==1 || (strlen(p)==2 && isdigit(*(p+1)))) { |
1274 | setvar(p, |
1280 | setvar(p,strevalue(pp)); return 0; |
1275 | } |
1281 | } |
1276 | /* search the number of the object */ |
1282 | /* search the number of the object */ |
1277 | i=search_list(objtab,obj_no,sizeof(objtab[0]),name); |
1283 | i=search_list(objtab,obj_no,sizeof(objtab[0]),name); |
1278 | if(i<0) { |
1284 | if(i<0) { |
1279 | error("bad_cmd"); return 1; |
1285 | error("bad_cmd"); return 1; |