Fossil SCM
Further pikchr improvements, specifically to the "fit" operator on cylinders.
Commit
939a13d94fc737fd03595a36dd3d6d32f2ea191277a89735b118aa6e9ae24587
Parent
7c6656595789c82…
1 file changed
+2
-2
+2
-2
| --- src/pikchr.c | ||
| +++ src/pikchr.c | ||
| @@ -3832,11 +3832,11 @@ | ||
| 3832 | 3832 | pObj->h = pik_value(p, "cylht",5,0); |
| 3833 | 3833 | pObj->rad = pik_value(p, "cylrad",6,0); /* Minor radius of ellipses */ |
| 3834 | 3834 | } |
| 3835 | 3835 | static void cylinderFit(Pik *p, PObj *pObj, PNum w, PNum h){ |
| 3836 | 3836 | if( w>0 ) pObj->w = w; |
| 3837 | - if( h>0 ) pObj->h = h + 4*pObj->rad + pObj->sw; | |
| 3837 | + if( h>0 ) pObj->h = h + 0.25*pObj->rad + pObj->sw; | |
| 3838 | 3838 | UNUSED_PARAMETER(p); |
| 3839 | 3839 | } |
| 3840 | 3840 | static void cylinderRender(Pik *p, PObj *pObj){ |
| 3841 | 3841 | PNum w2 = 0.5*pObj->w; |
| 3842 | 3842 | PNum h2 = 0.5*pObj->h; |
| @@ -4843,11 +4843,11 @@ | ||
| 4843 | 4843 | pik_txt_vertical_layout(pObj); |
| 4844 | 4844 | x = pObj->ptAt.x; |
| 4845 | 4845 | for(i=0; i<n; i++) allMask |= pObj->aTxt[i].eCode; |
| 4846 | 4846 | if( pObj->type->isLine ){ |
| 4847 | 4847 | hc = pObj->sw*1.5; |
| 4848 | - }else if( pObj->type->xInit==cylinderInit ){ | |
| 4848 | + }else if( pObj->rad>0.0 && pObj->type->xInit==cylinderInit ){ | |
| 4849 | 4849 | yBase = -0.75*pObj->rad; |
| 4850 | 4850 | } |
| 4851 | 4851 | if( allMask & TP_CENTER ){ |
| 4852 | 4852 | for(i=0; i<n; i++){ |
| 4853 | 4853 | if( pObj->aTxt[i].eCode & TP_CENTER ){ |
| 4854 | 4854 |
| --- src/pikchr.c | |
| +++ src/pikchr.c | |
| @@ -3832,11 +3832,11 @@ | |
| 3832 | pObj->h = pik_value(p, "cylht",5,0); |
| 3833 | pObj->rad = pik_value(p, "cylrad",6,0); /* Minor radius of ellipses */ |
| 3834 | } |
| 3835 | static void cylinderFit(Pik *p, PObj *pObj, PNum w, PNum h){ |
| 3836 | if( w>0 ) pObj->w = w; |
| 3837 | if( h>0 ) pObj->h = h + 4*pObj->rad + pObj->sw; |
| 3838 | UNUSED_PARAMETER(p); |
| 3839 | } |
| 3840 | static void cylinderRender(Pik *p, PObj *pObj){ |
| 3841 | PNum w2 = 0.5*pObj->w; |
| 3842 | PNum h2 = 0.5*pObj->h; |
| @@ -4843,11 +4843,11 @@ | |
| 4843 | pik_txt_vertical_layout(pObj); |
| 4844 | x = pObj->ptAt.x; |
| 4845 | for(i=0; i<n; i++) allMask |= pObj->aTxt[i].eCode; |
| 4846 | if( pObj->type->isLine ){ |
| 4847 | hc = pObj->sw*1.5; |
| 4848 | }else if( pObj->type->xInit==cylinderInit ){ |
| 4849 | yBase = -0.75*pObj->rad; |
| 4850 | } |
| 4851 | if( allMask & TP_CENTER ){ |
| 4852 | for(i=0; i<n; i++){ |
| 4853 | if( pObj->aTxt[i].eCode & TP_CENTER ){ |
| 4854 |
| --- src/pikchr.c | |
| +++ src/pikchr.c | |
| @@ -3832,11 +3832,11 @@ | |
| 3832 | pObj->h = pik_value(p, "cylht",5,0); |
| 3833 | pObj->rad = pik_value(p, "cylrad",6,0); /* Minor radius of ellipses */ |
| 3834 | } |
| 3835 | static void cylinderFit(Pik *p, PObj *pObj, PNum w, PNum h){ |
| 3836 | if( w>0 ) pObj->w = w; |
| 3837 | if( h>0 ) pObj->h = h + 0.25*pObj->rad + pObj->sw; |
| 3838 | UNUSED_PARAMETER(p); |
| 3839 | } |
| 3840 | static void cylinderRender(Pik *p, PObj *pObj){ |
| 3841 | PNum w2 = 0.5*pObj->w; |
| 3842 | PNum h2 = 0.5*pObj->h; |
| @@ -4843,11 +4843,11 @@ | |
| 4843 | pik_txt_vertical_layout(pObj); |
| 4844 | x = pObj->ptAt.x; |
| 4845 | for(i=0; i<n; i++) allMask |= pObj->aTxt[i].eCode; |
| 4846 | if( pObj->type->isLine ){ |
| 4847 | hc = pObj->sw*1.5; |
| 4848 | }else if( pObj->rad>0.0 && pObj->type->xInit==cylinderInit ){ |
| 4849 | yBase = -0.75*pObj->rad; |
| 4850 | } |
| 4851 | if( allMask & TP_CENTER ){ |
| 4852 | for(i=0; i<n; i++){ |
| 4853 | if( pObj->aTxt[i].eCode & TP_CENTER ){ |
| 4854 |