| | @@ -25,17 +25,17 @@ |
| 25 | 25 | ** The following is the concatenation of all %include directives from the |
| 26 | 26 | ** input grammar file: |
| 27 | 27 | */ |
| 28 | 28 | /************ Begin %include sections from the grammar ************************/ |
| 29 | 29 | #line 1 "VERSION.h" |
| 30 | | -#define MANIFEST_UUID "9b9b3133644ff804f8312bb839ad4eb43d1eb1869558f7a3a50b788b2c4a706a" |
| 31 | | -#define MANIFEST_VERSION "[9b9b313364]" |
| 32 | | -#define MANIFEST_DATE "2025-03-19 12:41:21" |
| 30 | +#define MANIFEST_UUID "8a43b020141f772a0ac45291a7fd73041d2efba5e3665c6bd2f334ad9b2e9845" |
| 31 | +#define MANIFEST_VERSION "[8a43b02014]" |
| 32 | +#define MANIFEST_DATE "2025-03-19 16:19:43" |
| 33 | 33 | #define MANIFEST_YEAR "2025" |
| 34 | | -#define MANIFEST_ISODATE "20250319124121" |
| 34 | +#define MANIFEST_ISODATE "20250319161943" |
| 35 | 35 | #define MANIFEST_NUMERIC_DATE 20250319 |
| 36 | | -#define MANIFEST_NUMERIC_TIME 124121 |
| 36 | +#define MANIFEST_NUMERIC_TIME 161943 |
| 37 | 37 | #define RELEASE_VERSION "1.0" |
| 38 | 38 | #define RELEASE_VERSION_NUMBER 10000 |
| 39 | 39 | #define RELEASE_RESOURCE_VERSION 1,0,0,0 |
| 40 | 40 | #define COMPILER "gcc-13.3.0" |
| 41 | 41 | #line 2 "pikchr.y" |
| | @@ -3687,44 +3687,57 @@ |
| 3687 | 3687 | ** than true arcs. Multiple reasons: (1) the legacy-PIC parameters |
| 3688 | 3688 | ** that control arcs are obscure and I could not figure out what they |
| 3689 | 3689 | ** mean based on available documentation. (2) Arcs are rarely used, |
| 3690 | 3690 | ** and so do not seem that important. |
| 3691 | 3691 | */ |
| 3692 | | -static PPoint arcControlPoint(int cw, PPoint f, PPoint t, PNum rScale, PNum rPct){ |
| 3692 | +static PPoint arcControlPoint(int cw, PPoint f, PPoint t){ |
| 3693 | 3693 | PPoint m; |
| 3694 | 3694 | PNum dx, dy; |
| 3695 | | - m.x = rPct*(f.x+t.x); |
| 3696 | | - m.y = rPct*(f.y+t.y); |
| 3695 | + m.x = 0.5*(f.x+t.x); |
| 3696 | + m.y = 0.5*(f.y+t.y); |
| 3697 | 3697 | dx = t.x - f.x; |
| 3698 | 3698 | dy = t.y - f.y; |
| 3699 | 3699 | if( cw ){ |
| 3700 | | - m.x -= 0.5*rScale*dy; |
| 3701 | | - m.y += 0.5*rScale*dx; |
| 3700 | + m.x -= 0.5*dy; |
| 3701 | + m.y += 0.5*dx; |
| 3702 | 3702 | }else{ |
| 3703 | | - m.x += 0.5*rScale*dy; |
| 3704 | | - m.y -= 0.5*rScale*dx; |
| 3703 | + m.x += 0.5*dy; |
| 3704 | + m.y -= 0.5*dx; |
| 3705 | 3705 | } |
| 3706 | 3706 | return m; |
| 3707 | 3707 | } |
| 3708 | 3708 | static void arcCheck(Pik *p, PObj *pObj){ |
| 3709 | | - PPoint m; |
| 3709 | + PPoint f, m, t; |
| 3710 | + PNum sw; |
| 3711 | + int i; |
| 3710 | 3712 | if( p->nTPath>2 ){ |
| 3711 | 3713 | pik_error(p, &pObj->errTok, "arc geometry error"); |
| 3712 | 3714 | return; |
| 3713 | 3715 | } |
| 3714 | | - m = arcControlPoint(pObj->cw, p->aTPath[0], p->aTPath[1], 0.5, 0.25); |
| 3715 | | - pik_bbox_add_xy(&pObj->bbox, m.x, m.y); |
| 3716 | | - m = arcControlPoint(pObj->cw, p->aTPath[0], p->aTPath[1], 0.5, 0.75); |
| 3717 | | - pik_bbox_add_xy(&pObj->bbox, m.x, m.y); |
| 3716 | + f = p->aTPath[0]; |
| 3717 | + t = p->aTPath[1]; |
| 3718 | + m = arcControlPoint(pObj->cw, f, t); |
| 3719 | + sw = pObj->sw; |
| 3720 | + for(i=1; i<16; i++){ |
| 3721 | + PNum t1, t2, a, b, c, x, y; |
| 3722 | + t1 = 0.0625*i; |
| 3723 | + t2 = 1.0 - t1; |
| 3724 | + a = t2*t2; |
| 3725 | + b = 2*t1*t2; |
| 3726 | + c = t1*t1; |
| 3727 | + x = a*f.x + b*m.x + c*t.x; |
| 3728 | + y = a*f.y + b*m.y + c*t.y; |
| 3729 | + pik_bbox_addellipse(&pObj->bbox, x, y, sw, sw); |
| 3730 | + } |
| 3718 | 3731 | } |
| 3719 | 3732 | static void arcRender(Pik *p, PObj *pObj){ |
| 3720 | 3733 | PPoint f, m, t; |
| 3721 | 3734 | if( pObj->nPath<2 ) return; |
| 3722 | 3735 | if( pObj->sw<0.0 ) return; |
| 3723 | 3736 | f = pObj->aPath[0]; |
| 3724 | 3737 | t = pObj->aPath[1]; |
| 3725 | | - m = arcControlPoint(pObj->cw,f,t,1.0,0.5); |
| 3738 | + m = arcControlPoint(pObj->cw,f,t); |
| 3726 | 3739 | if( pObj->larrow ){ |
| 3727 | 3740 | pik_draw_arrowhead(p,&m,&f,pObj); |
| 3728 | 3741 | } |
| 3729 | 3742 | if( pObj->rarrow ){ |
| 3730 | 3743 | pik_draw_arrowhead(p,&m,&t,pObj); |
| | @@ -8317,6 +8330,6 @@ |
| 8317 | 8330 | |
| 8318 | 8331 | |
| 8319 | 8332 | #endif /* PIKCHR_TCL */ |
| 8320 | 8333 | |
| 8321 | 8334 | |
| 8322 | | -#line 8322 "pikchr.c" |
| 8335 | +#line 8335 "pikchr.c" |
| 8323 | 8336 | |