Fossil SCM
In pikchr: fix minor details on drawing filled "file" objects and the "fit" operator on "cylinder" objects.
Commit
db02f9b8899f5c3c42bc5744d67f3b84833ee12f96e190f8f8b2315f43f78ed9
Parent
7c28d11d9ad2dc1…
1 file changed
+20
-15
+20
-15
| --- src/pikchr.c | ||
| +++ src/pikchr.c | ||
| @@ -398,11 +398,11 @@ | ||
| 398 | 398 | static void pik_append_y(Pik*,const char*,PNum,const char*); |
| 399 | 399 | static void pik_append_xy(Pik*,const char*,PNum,PNum); |
| 400 | 400 | static void pik_append_dis(Pik*,const char*,PNum,const char*); |
| 401 | 401 | static void pik_append_arc(Pik*,PNum,PNum,PNum,PNum); |
| 402 | 402 | static void pik_append_clr(Pik*,const char*,PNum,const char*); |
| 403 | -static void pik_append_style(Pik*,PElem*); | |
| 403 | +static void pik_append_style(Pik*,PElem*,int); | |
| 404 | 404 | static void pik_append_txt(Pik*,PElem*, PBox*); |
| 405 | 405 | static void pik_draw_arrowhead(Pik*,PPoint*pFrom,PPoint*pTo,PElem*); |
| 406 | 406 | static void pik_chop(PPoint*pFrom,PPoint*pTo,PNum); |
| 407 | 407 | static void pik_error(Pik*,PToken*,const char*); |
| 408 | 408 | static void pik_elist_free(Pik*,PEList*); |
| @@ -3517,11 +3517,11 @@ | ||
| 3517 | 3517 | } |
| 3518 | 3518 | pik_append_xy(p,"<path d=\"M", f.x, f.y); |
| 3519 | 3519 | pik_append_xy(p,"Q", m.x, m.y); |
| 3520 | 3520 | pik_append_xy(p," ", t.x, t.y); |
| 3521 | 3521 | pik_append(p,"\" ",2); |
| 3522 | - pik_append_style(p,pElem); | |
| 3522 | + pik_append_style(p,pElem,0); | |
| 3523 | 3523 | pik_append(p,"\" />\n", -1); |
| 3524 | 3524 | |
| 3525 | 3525 | pik_append_txt(p, pElem, 0); |
| 3526 | 3526 | } |
| 3527 | 3527 | |
| @@ -3660,11 +3660,11 @@ | ||
| 3660 | 3660 | pik_append_arc(p, rad, rad, x0, y2); |
| 3661 | 3661 | if( y2>y1 ) pik_append_xy(p, "L", x0, y1); |
| 3662 | 3662 | pik_append_arc(p, rad, rad, x1, y0); |
| 3663 | 3663 | pik_append(p,"Z\" ",-1); |
| 3664 | 3664 | } |
| 3665 | - pik_append_style(p,pElem); | |
| 3665 | + pik_append_style(p,pElem,1); | |
| 3666 | 3666 | pik_append(p,"\" />\n", -1); |
| 3667 | 3667 | } |
| 3668 | 3668 | pik_append_txt(p, pElem, 0); |
| 3669 | 3669 | } |
| 3670 | 3670 | |
| @@ -3722,11 +3722,11 @@ | ||
| 3722 | 3722 | PPoint pt = pElem->ptAt; |
| 3723 | 3723 | if( pElem->sw>0.0 ){ |
| 3724 | 3724 | pik_append_x(p,"<circle cx=\"", pt.x, "\""); |
| 3725 | 3725 | pik_append_y(p," cy=\"", pt.y, "\""); |
| 3726 | 3726 | pik_append_dis(p," r=\"", r, "\" "); |
| 3727 | - pik_append_style(p,pElem); | |
| 3727 | + pik_append_style(p,pElem,1); | |
| 3728 | 3728 | pik_append(p,"\" />\n", -1); |
| 3729 | 3729 | } |
| 3730 | 3730 | pik_append_txt(p, pElem, 0); |
| 3731 | 3731 | } |
| 3732 | 3732 | |
| @@ -3733,10 +3733,15 @@ | ||
| 3733 | 3733 | /* Methods for the "cylinder" class */ |
| 3734 | 3734 | static void cylinderInit(Pik *p, PElem *pElem){ |
| 3735 | 3735 | pElem->w = pik_value(p, "cylwid",6,0); |
| 3736 | 3736 | pElem->h = pik_value(p, "cylht",5,0); |
| 3737 | 3737 | pElem->rad = pik_value(p, "cylrad",6,0); /* Minor radius of ellipses */ |
| 3738 | +} | |
| 3739 | +static void cylinderFit(Pik *p, PElem *pElem, PNum w, PNum h){ | |
| 3740 | + if( w>0 ) pElem->w = w; | |
| 3741 | + if( h>0 ) pElem->h = h + 4*pElem->rad + pElem->sw; | |
| 3742 | + UNUSED_PARAMETER(p); | |
| 3738 | 3743 | } |
| 3739 | 3744 | static void cylinderRender(Pik *p, PElem *pElem){ |
| 3740 | 3745 | PNum w2 = 0.5*pElem->w; |
| 3741 | 3746 | PNum h2 = 0.5*pElem->h; |
| 3742 | 3747 | PNum rad = pElem->rad; |
| @@ -3747,11 +3752,11 @@ | ||
| 3747 | 3752 | pik_append_arc(p,w2,rad,pt.x+w2,pt.y-h2+rad); |
| 3748 | 3753 | pik_append_xy(p,"L", pt.x+w2,pt.y+h2-rad); |
| 3749 | 3754 | pik_append_arc(p,w2,rad,pt.x-w2,pt.y+h2-rad); |
| 3750 | 3755 | pik_append_arc(p,w2,rad,pt.x+w2,pt.y+h2-rad); |
| 3751 | 3756 | pik_append(p,"\" ",-1); |
| 3752 | - pik_append_style(p,pElem); | |
| 3757 | + pik_append_style(p,pElem,1); | |
| 3753 | 3758 | pik_append(p,"\" />\n", -1); |
| 3754 | 3759 | } |
| 3755 | 3760 | pik_append_txt(p, pElem, 0); |
| 3756 | 3761 | } |
| 3757 | 3762 | static PPoint cylinderOffset(Pik *p, PElem *pElem, int cp){ |
| @@ -3810,11 +3815,11 @@ | ||
| 3810 | 3815 | PPoint pt = pElem->ptAt; |
| 3811 | 3816 | if( pElem->sw>0.0 ){ |
| 3812 | 3817 | pik_append_x(p,"<circle cx=\"", pt.x, "\""); |
| 3813 | 3818 | pik_append_y(p," cy=\"", pt.y, "\""); |
| 3814 | 3819 | pik_append_dis(p," r=\"", r, "\""); |
| 3815 | - pik_append_style(p,pElem); | |
| 3820 | + pik_append_style(p,pElem,1); | |
| 3816 | 3821 | pik_append(p,"\" />\n", -1); |
| 3817 | 3822 | } |
| 3818 | 3823 | pik_append_txt(p, pElem, 0); |
| 3819 | 3824 | } |
| 3820 | 3825 | |
| @@ -3868,11 +3873,11 @@ | ||
| 3868 | 3873 | if( pElem->sw>0.0 ){ |
| 3869 | 3874 | pik_append_x(p,"<ellipse cx=\"", pt.x, "\""); |
| 3870 | 3875 | pik_append_y(p," cy=\"", pt.y, "\""); |
| 3871 | 3876 | pik_append_dis(p," rx=\"", w/2.0, "\""); |
| 3872 | 3877 | pik_append_dis(p," ry=\"", h/2.0, "\" "); |
| 3873 | - pik_append_style(p,pElem); | |
| 3878 | + pik_append_style(p,pElem,1); | |
| 3874 | 3879 | pik_append(p,"\" />\n", -1); |
| 3875 | 3880 | } |
| 3876 | 3881 | pik_append_txt(p, pElem, 0); |
| 3877 | 3882 | } |
| 3878 | 3883 | |
| @@ -3926,17 +3931,17 @@ | ||
| 3926 | 3931 | pik_append_xy(p,"L", pt.x+w2,pt.y-h2); |
| 3927 | 3932 | pik_append_xy(p,"L", pt.x+w2,pt.y+(h2-rad)); |
| 3928 | 3933 | pik_append_xy(p,"L", pt.x+(w2-rad),pt.y+h2); |
| 3929 | 3934 | pik_append_xy(p,"L", pt.x-w2,pt.y+h2); |
| 3930 | 3935 | pik_append(p,"Z\" ",-1); |
| 3931 | - pik_append_style(p,pElem); | |
| 3936 | + pik_append_style(p,pElem,1); | |
| 3932 | 3937 | pik_append(p,"\" />\n",-1); |
| 3933 | 3938 | pik_append_xy(p,"<path d=\"M", pt.x+(w2-rad), pt.y+h2); |
| 3934 | 3939 | pik_append_xy(p,"L", pt.x+(w2-rad),pt.y+(h2-rad)); |
| 3935 | 3940 | pik_append_xy(p,"L", pt.x+w2, pt.y+(h2-rad)); |
| 3936 | 3941 | pik_append(p,"\" ",-1); |
| 3937 | - pik_append_style(p,pElem); | |
| 3942 | + pik_append_style(p,pElem,0); | |
| 3938 | 3943 | pik_append(p,"\" />\n",-1); |
| 3939 | 3944 | } |
| 3940 | 3945 | pik_append_txt(p, pElem, 0); |
| 3941 | 3946 | } |
| 3942 | 3947 | |
| @@ -3980,11 +3985,11 @@ | ||
| 3980 | 3985 | pik_append(p,"Z",1); |
| 3981 | 3986 | }else{ |
| 3982 | 3987 | pElem->fill = -1.0; |
| 3983 | 3988 | } |
| 3984 | 3989 | pik_append(p,"\" ",-1); |
| 3985 | - pik_append_style(p,pElem); | |
| 3990 | + pik_append_style(p,pElem,pElem->bClose); | |
| 3986 | 3991 | pik_append(p,"\" />\n", -1); |
| 3987 | 3992 | } |
| 3988 | 3993 | pik_append_txt(p, pElem, 0); |
| 3989 | 3994 | } |
| 3990 | 3995 | |
| @@ -4072,11 +4077,11 @@ | ||
| 4072 | 4077 | pik_append_xy(p," L ",m.x,m.y); |
| 4073 | 4078 | } |
| 4074 | 4079 | } |
| 4075 | 4080 | pik_append_xy(p," L ",a[i].x,a[i].y); |
| 4076 | 4081 | pik_append(p,"\" ",-1); |
| 4077 | - pik_append_style(p,pElem); | |
| 4082 | + pik_append_style(p,pElem,0); | |
| 4078 | 4083 | pik_append(p,"\" />\n", -1); |
| 4079 | 4084 | } |
| 4080 | 4085 | static void splineRender(Pik *p, PElem *pElem){ |
| 4081 | 4086 | if( pElem->sw>0.0 ){ |
| 4082 | 4087 | int n = pElem->nPath; |
| @@ -4184,11 +4189,11 @@ | ||
| 4184 | 4189 | /* xInit */ cylinderInit, |
| 4185 | 4190 | /* xNumProp */ 0, |
| 4186 | 4191 | /* xCheck */ 0, |
| 4187 | 4192 | /* xChop */ boxChop, |
| 4188 | 4193 | /* xOffset */ cylinderOffset, |
| 4189 | - /* xFit */ 0, | |
| 4194 | + /* xFit */ cylinderFit, | |
| 4190 | 4195 | /* xRender */ cylinderRender |
| 4191 | 4196 | }, |
| 4192 | 4197 | { /* name */ "dot", |
| 4193 | 4198 | /* isline */ 0, |
| 4194 | 4199 | /* eJust */ 0, |
| @@ -4506,13 +4511,13 @@ | ||
| 4506 | 4511 | } |
| 4507 | 4512 | |
| 4508 | 4513 | /* Append a style="..." text. But, leave the quote unterminated, in case |
| 4509 | 4514 | ** the caller wants to add some more. |
| 4510 | 4515 | */ |
| 4511 | -static void pik_append_style(Pik *p, PElem *pElem){ | |
| 4516 | +static void pik_append_style(Pik *p, PElem *pElem, int bFill){ | |
| 4512 | 4517 | pik_append(p, " style=\"", -1); |
| 4513 | - if( pElem->fill>=0 ){ | |
| 4518 | + if( pElem->fill>=0 && bFill ){ | |
| 4514 | 4519 | pik_append_clr(p, "fill:", pElem->fill, ";"); |
| 4515 | 4520 | }else{ |
| 4516 | 4521 | pik_append(p,"fill:none;",-1); |
| 4517 | 4522 | } |
| 4518 | 4523 | if( pElem->sw>0.0 && pElem->color>=0.0 ){ |
| @@ -7059,6 +7064,6 @@ | ||
| 7059 | 7064 | printf("</body></html>\n"); |
| 7060 | 7065 | return 0; |
| 7061 | 7066 | } |
| 7062 | 7067 | #endif /* PIKCHR_SHELL */ |
| 7063 | 7068 | |
| 7064 | -#line 7089 "pikchr.c" | |
| 7069 | +#line 7094 "pikchr.c" | |
| 7065 | 7070 |
| --- src/pikchr.c | |
| +++ src/pikchr.c | |
| @@ -398,11 +398,11 @@ | |
| 398 | static void pik_append_y(Pik*,const char*,PNum,const char*); |
| 399 | static void pik_append_xy(Pik*,const char*,PNum,PNum); |
| 400 | static void pik_append_dis(Pik*,const char*,PNum,const char*); |
| 401 | static void pik_append_arc(Pik*,PNum,PNum,PNum,PNum); |
| 402 | static void pik_append_clr(Pik*,const char*,PNum,const char*); |
| 403 | static void pik_append_style(Pik*,PElem*); |
| 404 | static void pik_append_txt(Pik*,PElem*, PBox*); |
| 405 | static void pik_draw_arrowhead(Pik*,PPoint*pFrom,PPoint*pTo,PElem*); |
| 406 | static void pik_chop(PPoint*pFrom,PPoint*pTo,PNum); |
| 407 | static void pik_error(Pik*,PToken*,const char*); |
| 408 | static void pik_elist_free(Pik*,PEList*); |
| @@ -3517,11 +3517,11 @@ | |
| 3517 | } |
| 3518 | pik_append_xy(p,"<path d=\"M", f.x, f.y); |
| 3519 | pik_append_xy(p,"Q", m.x, m.y); |
| 3520 | pik_append_xy(p," ", t.x, t.y); |
| 3521 | pik_append(p,"\" ",2); |
| 3522 | pik_append_style(p,pElem); |
| 3523 | pik_append(p,"\" />\n", -1); |
| 3524 | |
| 3525 | pik_append_txt(p, pElem, 0); |
| 3526 | } |
| 3527 | |
| @@ -3660,11 +3660,11 @@ | |
| 3660 | pik_append_arc(p, rad, rad, x0, y2); |
| 3661 | if( y2>y1 ) pik_append_xy(p, "L", x0, y1); |
| 3662 | pik_append_arc(p, rad, rad, x1, y0); |
| 3663 | pik_append(p,"Z\" ",-1); |
| 3664 | } |
| 3665 | pik_append_style(p,pElem); |
| 3666 | pik_append(p,"\" />\n", -1); |
| 3667 | } |
| 3668 | pik_append_txt(p, pElem, 0); |
| 3669 | } |
| 3670 | |
| @@ -3722,11 +3722,11 @@ | |
| 3722 | PPoint pt = pElem->ptAt; |
| 3723 | if( pElem->sw>0.0 ){ |
| 3724 | pik_append_x(p,"<circle cx=\"", pt.x, "\""); |
| 3725 | pik_append_y(p," cy=\"", pt.y, "\""); |
| 3726 | pik_append_dis(p," r=\"", r, "\" "); |
| 3727 | pik_append_style(p,pElem); |
| 3728 | pik_append(p,"\" />\n", -1); |
| 3729 | } |
| 3730 | pik_append_txt(p, pElem, 0); |
| 3731 | } |
| 3732 | |
| @@ -3733,10 +3733,15 @@ | |
| 3733 | /* Methods for the "cylinder" class */ |
| 3734 | static void cylinderInit(Pik *p, PElem *pElem){ |
| 3735 | pElem->w = pik_value(p, "cylwid",6,0); |
| 3736 | pElem->h = pik_value(p, "cylht",5,0); |
| 3737 | pElem->rad = pik_value(p, "cylrad",6,0); /* Minor radius of ellipses */ |
| 3738 | } |
| 3739 | static void cylinderRender(Pik *p, PElem *pElem){ |
| 3740 | PNum w2 = 0.5*pElem->w; |
| 3741 | PNum h2 = 0.5*pElem->h; |
| 3742 | PNum rad = pElem->rad; |
| @@ -3747,11 +3752,11 @@ | |
| 3747 | pik_append_arc(p,w2,rad,pt.x+w2,pt.y-h2+rad); |
| 3748 | pik_append_xy(p,"L", pt.x+w2,pt.y+h2-rad); |
| 3749 | pik_append_arc(p,w2,rad,pt.x-w2,pt.y+h2-rad); |
| 3750 | pik_append_arc(p,w2,rad,pt.x+w2,pt.y+h2-rad); |
| 3751 | pik_append(p,"\" ",-1); |
| 3752 | pik_append_style(p,pElem); |
| 3753 | pik_append(p,"\" />\n", -1); |
| 3754 | } |
| 3755 | pik_append_txt(p, pElem, 0); |
| 3756 | } |
| 3757 | static PPoint cylinderOffset(Pik *p, PElem *pElem, int cp){ |
| @@ -3810,11 +3815,11 @@ | |
| 3810 | PPoint pt = pElem->ptAt; |
| 3811 | if( pElem->sw>0.0 ){ |
| 3812 | pik_append_x(p,"<circle cx=\"", pt.x, "\""); |
| 3813 | pik_append_y(p," cy=\"", pt.y, "\""); |
| 3814 | pik_append_dis(p," r=\"", r, "\""); |
| 3815 | pik_append_style(p,pElem); |
| 3816 | pik_append(p,"\" />\n", -1); |
| 3817 | } |
| 3818 | pik_append_txt(p, pElem, 0); |
| 3819 | } |
| 3820 | |
| @@ -3868,11 +3873,11 @@ | |
| 3868 | if( pElem->sw>0.0 ){ |
| 3869 | pik_append_x(p,"<ellipse cx=\"", pt.x, "\""); |
| 3870 | pik_append_y(p," cy=\"", pt.y, "\""); |
| 3871 | pik_append_dis(p," rx=\"", w/2.0, "\""); |
| 3872 | pik_append_dis(p," ry=\"", h/2.0, "\" "); |
| 3873 | pik_append_style(p,pElem); |
| 3874 | pik_append(p,"\" />\n", -1); |
| 3875 | } |
| 3876 | pik_append_txt(p, pElem, 0); |
| 3877 | } |
| 3878 | |
| @@ -3926,17 +3931,17 @@ | |
| 3926 | pik_append_xy(p,"L", pt.x+w2,pt.y-h2); |
| 3927 | pik_append_xy(p,"L", pt.x+w2,pt.y+(h2-rad)); |
| 3928 | pik_append_xy(p,"L", pt.x+(w2-rad),pt.y+h2); |
| 3929 | pik_append_xy(p,"L", pt.x-w2,pt.y+h2); |
| 3930 | pik_append(p,"Z\" ",-1); |
| 3931 | pik_append_style(p,pElem); |
| 3932 | pik_append(p,"\" />\n",-1); |
| 3933 | pik_append_xy(p,"<path d=\"M", pt.x+(w2-rad), pt.y+h2); |
| 3934 | pik_append_xy(p,"L", pt.x+(w2-rad),pt.y+(h2-rad)); |
| 3935 | pik_append_xy(p,"L", pt.x+w2, pt.y+(h2-rad)); |
| 3936 | pik_append(p,"\" ",-1); |
| 3937 | pik_append_style(p,pElem); |
| 3938 | pik_append(p,"\" />\n",-1); |
| 3939 | } |
| 3940 | pik_append_txt(p, pElem, 0); |
| 3941 | } |
| 3942 | |
| @@ -3980,11 +3985,11 @@ | |
| 3980 | pik_append(p,"Z",1); |
| 3981 | }else{ |
| 3982 | pElem->fill = -1.0; |
| 3983 | } |
| 3984 | pik_append(p,"\" ",-1); |
| 3985 | pik_append_style(p,pElem); |
| 3986 | pik_append(p,"\" />\n", -1); |
| 3987 | } |
| 3988 | pik_append_txt(p, pElem, 0); |
| 3989 | } |
| 3990 | |
| @@ -4072,11 +4077,11 @@ | |
| 4072 | pik_append_xy(p," L ",m.x,m.y); |
| 4073 | } |
| 4074 | } |
| 4075 | pik_append_xy(p," L ",a[i].x,a[i].y); |
| 4076 | pik_append(p,"\" ",-1); |
| 4077 | pik_append_style(p,pElem); |
| 4078 | pik_append(p,"\" />\n", -1); |
| 4079 | } |
| 4080 | static void splineRender(Pik *p, PElem *pElem){ |
| 4081 | if( pElem->sw>0.0 ){ |
| 4082 | int n = pElem->nPath; |
| @@ -4184,11 +4189,11 @@ | |
| 4184 | /* xInit */ cylinderInit, |
| 4185 | /* xNumProp */ 0, |
| 4186 | /* xCheck */ 0, |
| 4187 | /* xChop */ boxChop, |
| 4188 | /* xOffset */ cylinderOffset, |
| 4189 | /* xFit */ 0, |
| 4190 | /* xRender */ cylinderRender |
| 4191 | }, |
| 4192 | { /* name */ "dot", |
| 4193 | /* isline */ 0, |
| 4194 | /* eJust */ 0, |
| @@ -4506,13 +4511,13 @@ | |
| 4506 | } |
| 4507 | |
| 4508 | /* Append a style="..." text. But, leave the quote unterminated, in case |
| 4509 | ** the caller wants to add some more. |
| 4510 | */ |
| 4511 | static void pik_append_style(Pik *p, PElem *pElem){ |
| 4512 | pik_append(p, " style=\"", -1); |
| 4513 | if( pElem->fill>=0 ){ |
| 4514 | pik_append_clr(p, "fill:", pElem->fill, ";"); |
| 4515 | }else{ |
| 4516 | pik_append(p,"fill:none;",-1); |
| 4517 | } |
| 4518 | if( pElem->sw>0.0 && pElem->color>=0.0 ){ |
| @@ -7059,6 +7064,6 @@ | |
| 7059 | printf("</body></html>\n"); |
| 7060 | return 0; |
| 7061 | } |
| 7062 | #endif /* PIKCHR_SHELL */ |
| 7063 | |
| 7064 | #line 7089 "pikchr.c" |
| 7065 |
| --- src/pikchr.c | |
| +++ src/pikchr.c | |
| @@ -398,11 +398,11 @@ | |
| 398 | static void pik_append_y(Pik*,const char*,PNum,const char*); |
| 399 | static void pik_append_xy(Pik*,const char*,PNum,PNum); |
| 400 | static void pik_append_dis(Pik*,const char*,PNum,const char*); |
| 401 | static void pik_append_arc(Pik*,PNum,PNum,PNum,PNum); |
| 402 | static void pik_append_clr(Pik*,const char*,PNum,const char*); |
| 403 | static void pik_append_style(Pik*,PElem*,int); |
| 404 | static void pik_append_txt(Pik*,PElem*, PBox*); |
| 405 | static void pik_draw_arrowhead(Pik*,PPoint*pFrom,PPoint*pTo,PElem*); |
| 406 | static void pik_chop(PPoint*pFrom,PPoint*pTo,PNum); |
| 407 | static void pik_error(Pik*,PToken*,const char*); |
| 408 | static void pik_elist_free(Pik*,PEList*); |
| @@ -3517,11 +3517,11 @@ | |
| 3517 | } |
| 3518 | pik_append_xy(p,"<path d=\"M", f.x, f.y); |
| 3519 | pik_append_xy(p,"Q", m.x, m.y); |
| 3520 | pik_append_xy(p," ", t.x, t.y); |
| 3521 | pik_append(p,"\" ",2); |
| 3522 | pik_append_style(p,pElem,0); |
| 3523 | pik_append(p,"\" />\n", -1); |
| 3524 | |
| 3525 | pik_append_txt(p, pElem, 0); |
| 3526 | } |
| 3527 | |
| @@ -3660,11 +3660,11 @@ | |
| 3660 | pik_append_arc(p, rad, rad, x0, y2); |
| 3661 | if( y2>y1 ) pik_append_xy(p, "L", x0, y1); |
| 3662 | pik_append_arc(p, rad, rad, x1, y0); |
| 3663 | pik_append(p,"Z\" ",-1); |
| 3664 | } |
| 3665 | pik_append_style(p,pElem,1); |
| 3666 | pik_append(p,"\" />\n", -1); |
| 3667 | } |
| 3668 | pik_append_txt(p, pElem, 0); |
| 3669 | } |
| 3670 | |
| @@ -3722,11 +3722,11 @@ | |
| 3722 | PPoint pt = pElem->ptAt; |
| 3723 | if( pElem->sw>0.0 ){ |
| 3724 | pik_append_x(p,"<circle cx=\"", pt.x, "\""); |
| 3725 | pik_append_y(p," cy=\"", pt.y, "\""); |
| 3726 | pik_append_dis(p," r=\"", r, "\" "); |
| 3727 | pik_append_style(p,pElem,1); |
| 3728 | pik_append(p,"\" />\n", -1); |
| 3729 | } |
| 3730 | pik_append_txt(p, pElem, 0); |
| 3731 | } |
| 3732 | |
| @@ -3733,10 +3733,15 @@ | |
| 3733 | /* Methods for the "cylinder" class */ |
| 3734 | static void cylinderInit(Pik *p, PElem *pElem){ |
| 3735 | pElem->w = pik_value(p, "cylwid",6,0); |
| 3736 | pElem->h = pik_value(p, "cylht",5,0); |
| 3737 | pElem->rad = pik_value(p, "cylrad",6,0); /* Minor radius of ellipses */ |
| 3738 | } |
| 3739 | static void cylinderFit(Pik *p, PElem *pElem, PNum w, PNum h){ |
| 3740 | if( w>0 ) pElem->w = w; |
| 3741 | if( h>0 ) pElem->h = h + 4*pElem->rad + pElem->sw; |
| 3742 | UNUSED_PARAMETER(p); |
| 3743 | } |
| 3744 | static void cylinderRender(Pik *p, PElem *pElem){ |
| 3745 | PNum w2 = 0.5*pElem->w; |
| 3746 | PNum h2 = 0.5*pElem->h; |
| 3747 | PNum rad = pElem->rad; |
| @@ -3747,11 +3752,11 @@ | |
| 3752 | pik_append_arc(p,w2,rad,pt.x+w2,pt.y-h2+rad); |
| 3753 | pik_append_xy(p,"L", pt.x+w2,pt.y+h2-rad); |
| 3754 | pik_append_arc(p,w2,rad,pt.x-w2,pt.y+h2-rad); |
| 3755 | pik_append_arc(p,w2,rad,pt.x+w2,pt.y+h2-rad); |
| 3756 | pik_append(p,"\" ",-1); |
| 3757 | pik_append_style(p,pElem,1); |
| 3758 | pik_append(p,"\" />\n", -1); |
| 3759 | } |
| 3760 | pik_append_txt(p, pElem, 0); |
| 3761 | } |
| 3762 | static PPoint cylinderOffset(Pik *p, PElem *pElem, int cp){ |
| @@ -3810,11 +3815,11 @@ | |
| 3815 | PPoint pt = pElem->ptAt; |
| 3816 | if( pElem->sw>0.0 ){ |
| 3817 | pik_append_x(p,"<circle cx=\"", pt.x, "\""); |
| 3818 | pik_append_y(p," cy=\"", pt.y, "\""); |
| 3819 | pik_append_dis(p," r=\"", r, "\""); |
| 3820 | pik_append_style(p,pElem,1); |
| 3821 | pik_append(p,"\" />\n", -1); |
| 3822 | } |
| 3823 | pik_append_txt(p, pElem, 0); |
| 3824 | } |
| 3825 | |
| @@ -3868,11 +3873,11 @@ | |
| 3873 | if( pElem->sw>0.0 ){ |
| 3874 | pik_append_x(p,"<ellipse cx=\"", pt.x, "\""); |
| 3875 | pik_append_y(p," cy=\"", pt.y, "\""); |
| 3876 | pik_append_dis(p," rx=\"", w/2.0, "\""); |
| 3877 | pik_append_dis(p," ry=\"", h/2.0, "\" "); |
| 3878 | pik_append_style(p,pElem,1); |
| 3879 | pik_append(p,"\" />\n", -1); |
| 3880 | } |
| 3881 | pik_append_txt(p, pElem, 0); |
| 3882 | } |
| 3883 | |
| @@ -3926,17 +3931,17 @@ | |
| 3931 | pik_append_xy(p,"L", pt.x+w2,pt.y-h2); |
| 3932 | pik_append_xy(p,"L", pt.x+w2,pt.y+(h2-rad)); |
| 3933 | pik_append_xy(p,"L", pt.x+(w2-rad),pt.y+h2); |
| 3934 | pik_append_xy(p,"L", pt.x-w2,pt.y+h2); |
| 3935 | pik_append(p,"Z\" ",-1); |
| 3936 | pik_append_style(p,pElem,1); |
| 3937 | pik_append(p,"\" />\n",-1); |
| 3938 | pik_append_xy(p,"<path d=\"M", pt.x+(w2-rad), pt.y+h2); |
| 3939 | pik_append_xy(p,"L", pt.x+(w2-rad),pt.y+(h2-rad)); |
| 3940 | pik_append_xy(p,"L", pt.x+w2, pt.y+(h2-rad)); |
| 3941 | pik_append(p,"\" ",-1); |
| 3942 | pik_append_style(p,pElem,0); |
| 3943 | pik_append(p,"\" />\n",-1); |
| 3944 | } |
| 3945 | pik_append_txt(p, pElem, 0); |
| 3946 | } |
| 3947 | |
| @@ -3980,11 +3985,11 @@ | |
| 3985 | pik_append(p,"Z",1); |
| 3986 | }else{ |
| 3987 | pElem->fill = -1.0; |
| 3988 | } |
| 3989 | pik_append(p,"\" ",-1); |
| 3990 | pik_append_style(p,pElem,pElem->bClose); |
| 3991 | pik_append(p,"\" />\n", -1); |
| 3992 | } |
| 3993 | pik_append_txt(p, pElem, 0); |
| 3994 | } |
| 3995 | |
| @@ -4072,11 +4077,11 @@ | |
| 4077 | pik_append_xy(p," L ",m.x,m.y); |
| 4078 | } |
| 4079 | } |
| 4080 | pik_append_xy(p," L ",a[i].x,a[i].y); |
| 4081 | pik_append(p,"\" ",-1); |
| 4082 | pik_append_style(p,pElem,0); |
| 4083 | pik_append(p,"\" />\n", -1); |
| 4084 | } |
| 4085 | static void splineRender(Pik *p, PElem *pElem){ |
| 4086 | if( pElem->sw>0.0 ){ |
| 4087 | int n = pElem->nPath; |
| @@ -4184,11 +4189,11 @@ | |
| 4189 | /* xInit */ cylinderInit, |
| 4190 | /* xNumProp */ 0, |
| 4191 | /* xCheck */ 0, |
| 4192 | /* xChop */ boxChop, |
| 4193 | /* xOffset */ cylinderOffset, |
| 4194 | /* xFit */ cylinderFit, |
| 4195 | /* xRender */ cylinderRender |
| 4196 | }, |
| 4197 | { /* name */ "dot", |
| 4198 | /* isline */ 0, |
| 4199 | /* eJust */ 0, |
| @@ -4506,13 +4511,13 @@ | |
| 4511 | } |
| 4512 | |
| 4513 | /* Append a style="..." text. But, leave the quote unterminated, in case |
| 4514 | ** the caller wants to add some more. |
| 4515 | */ |
| 4516 | static void pik_append_style(Pik *p, PElem *pElem, int bFill){ |
| 4517 | pik_append(p, " style=\"", -1); |
| 4518 | if( pElem->fill>=0 && bFill ){ |
| 4519 | pik_append_clr(p, "fill:", pElem->fill, ";"); |
| 4520 | }else{ |
| 4521 | pik_append(p,"fill:none;",-1); |
| 4522 | } |
| 4523 | if( pElem->sw>0.0 && pElem->color>=0.0 ){ |
| @@ -7059,6 +7064,6 @@ | |
| 7064 | printf("</body></html>\n"); |
| 7065 | return 0; |
| 7066 | } |
| 7067 | #endif /* PIKCHR_SHELL */ |
| 7068 | |
| 7069 | #line 7094 "pikchr.c" |
| 7070 |