Fossil SCM
Update the built-in Pikchr to the latest version that fixes the issue with bounding boxes on rotated arcs.
Commit
91dabe4b35ac3066e0bd09d399023f89a2d825deebfe2828392e24cc55eb9b18
Parent
f60bd4a752ea539…
1 file changed
+14
-12
+14
-12
| --- extsrc/pikchr.c | ||
| +++ extsrc/pikchr.c | ||
| @@ -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 "052f07296e76ab2312caf2a4bf6237e574b3e533c7a36ee8f34db833baa3efb4" | |
| 31 | -#define MANIFEST_VERSION "[052f07296e]" | |
| 32 | -#define MANIFEST_DATE "2025-03-05 10:54:16" | |
| 30 | +#define MANIFEST_UUID "9b9b3133644ff804f8312bb839ad4eb43d1eb1869558f7a3a50b788b2c4a706a" | |
| 31 | +#define MANIFEST_VERSION "[9b9b313364]" | |
| 32 | +#define MANIFEST_DATE "2025-03-19 12:41:21" | |
| 33 | 33 | #define MANIFEST_YEAR "2025" |
| 34 | -#define MANIFEST_ISODATE "20250305105416" | |
| 35 | -#define MANIFEST_NUMERIC_DATE 20250305 | |
| 36 | -#define MANIFEST_NUMERIC_TIME 105416 | |
| 34 | +#define MANIFEST_ISODATE "20250319124121" | |
| 35 | +#define MANIFEST_NUMERIC_DATE 20250319 | |
| 36 | +#define MANIFEST_NUMERIC_TIME 124121 | |
| 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,15 +3687,15 @@ | ||
| 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){ | |
| 3692 | +static PPoint arcControlPoint(int cw, PPoint f, PPoint t, PNum rScale, PNum rPct){ | |
| 3693 | 3693 | PPoint m; |
| 3694 | 3694 | PNum dx, dy; |
| 3695 | - m.x = 0.5*(f.x+t.x); | |
| 3696 | - m.y = 0.5*(f.y+t.y); | |
| 3695 | + m.x = rPct*(f.x+t.x); | |
| 3696 | + m.y = rPct*(f.y+t.y); | |
| 3697 | 3697 | dx = t.x - f.x; |
| 3698 | 3698 | dy = t.y - f.y; |
| 3699 | 3699 | if( cw ){ |
| 3700 | 3700 | m.x -= 0.5*rScale*dy; |
| 3701 | 3701 | m.y += 0.5*rScale*dx; |
| @@ -3709,20 +3709,22 @@ | ||
| 3709 | 3709 | PPoint m; |
| 3710 | 3710 | if( p->nTPath>2 ){ |
| 3711 | 3711 | pik_error(p, &pObj->errTok, "arc geometry error"); |
| 3712 | 3712 | return; |
| 3713 | 3713 | } |
| 3714 | - m = arcControlPoint(pObj->cw, p->aTPath[0], p->aTPath[1], 0.5); | |
| 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); | |
| 3715 | 3717 | pik_bbox_add_xy(&pObj->bbox, m.x, m.y); |
| 3716 | 3718 | } |
| 3717 | 3719 | static void arcRender(Pik *p, PObj *pObj){ |
| 3718 | 3720 | PPoint f, m, t; |
| 3719 | 3721 | if( pObj->nPath<2 ) return; |
| 3720 | 3722 | if( pObj->sw<0.0 ) return; |
| 3721 | 3723 | f = pObj->aPath[0]; |
| 3722 | 3724 | t = pObj->aPath[1]; |
| 3723 | - m = arcControlPoint(pObj->cw,f,t,1.0); | |
| 3725 | + m = arcControlPoint(pObj->cw,f,t,1.0,0.5); | |
| 3724 | 3726 | if( pObj->larrow ){ |
| 3725 | 3727 | pik_draw_arrowhead(p,&m,&f,pObj); |
| 3726 | 3728 | } |
| 3727 | 3729 | if( pObj->rarrow ){ |
| 3728 | 3730 | pik_draw_arrowhead(p,&m,&t,pObj); |
| @@ -8315,6 +8317,6 @@ | ||
| 8315 | 8317 | |
| 8316 | 8318 | |
| 8317 | 8319 | #endif /* PIKCHR_TCL */ |
| 8318 | 8320 | |
| 8319 | 8321 | |
| 8320 | -#line 8320 "pikchr.c" | |
| 8322 | +#line 8322 "pikchr.c" | |
| 8321 | 8323 |
| --- extsrc/pikchr.c | |
| +++ extsrc/pikchr.c | |
| @@ -25,17 +25,17 @@ | |
| 25 | ** The following is the concatenation of all %include directives from the |
| 26 | ** input grammar file: |
| 27 | */ |
| 28 | /************ Begin %include sections from the grammar ************************/ |
| 29 | #line 1 "VERSION.h" |
| 30 | #define MANIFEST_UUID "052f07296e76ab2312caf2a4bf6237e574b3e533c7a36ee8f34db833baa3efb4" |
| 31 | #define MANIFEST_VERSION "[052f07296e]" |
| 32 | #define MANIFEST_DATE "2025-03-05 10:54:16" |
| 33 | #define MANIFEST_YEAR "2025" |
| 34 | #define MANIFEST_ISODATE "20250305105416" |
| 35 | #define MANIFEST_NUMERIC_DATE 20250305 |
| 36 | #define MANIFEST_NUMERIC_TIME 105416 |
| 37 | #define RELEASE_VERSION "1.0" |
| 38 | #define RELEASE_VERSION_NUMBER 10000 |
| 39 | #define RELEASE_RESOURCE_VERSION 1,0,0,0 |
| 40 | #define COMPILER "gcc-13.3.0" |
| 41 | #line 2 "pikchr.y" |
| @@ -3687,15 +3687,15 @@ | |
| 3687 | ** than true arcs. Multiple reasons: (1) the legacy-PIC parameters |
| 3688 | ** that control arcs are obscure and I could not figure out what they |
| 3689 | ** mean based on available documentation. (2) Arcs are rarely used, |
| 3690 | ** and so do not seem that important. |
| 3691 | */ |
| 3692 | static PPoint arcControlPoint(int cw, PPoint f, PPoint t, PNum rScale){ |
| 3693 | PPoint m; |
| 3694 | PNum dx, dy; |
| 3695 | m.x = 0.5*(f.x+t.x); |
| 3696 | m.y = 0.5*(f.y+t.y); |
| 3697 | dx = t.x - f.x; |
| 3698 | dy = t.y - f.y; |
| 3699 | if( cw ){ |
| 3700 | m.x -= 0.5*rScale*dy; |
| 3701 | m.y += 0.5*rScale*dx; |
| @@ -3709,20 +3709,22 @@ | |
| 3709 | PPoint m; |
| 3710 | if( p->nTPath>2 ){ |
| 3711 | pik_error(p, &pObj->errTok, "arc geometry error"); |
| 3712 | return; |
| 3713 | } |
| 3714 | m = arcControlPoint(pObj->cw, p->aTPath[0], p->aTPath[1], 0.5); |
| 3715 | pik_bbox_add_xy(&pObj->bbox, m.x, m.y); |
| 3716 | } |
| 3717 | static void arcRender(Pik *p, PObj *pObj){ |
| 3718 | PPoint f, m, t; |
| 3719 | if( pObj->nPath<2 ) return; |
| 3720 | if( pObj->sw<0.0 ) return; |
| 3721 | f = pObj->aPath[0]; |
| 3722 | t = pObj->aPath[1]; |
| 3723 | m = arcControlPoint(pObj->cw,f,t,1.0); |
| 3724 | if( pObj->larrow ){ |
| 3725 | pik_draw_arrowhead(p,&m,&f,pObj); |
| 3726 | } |
| 3727 | if( pObj->rarrow ){ |
| 3728 | pik_draw_arrowhead(p,&m,&t,pObj); |
| @@ -8315,6 +8317,6 @@ | |
| 8315 | |
| 8316 | |
| 8317 | #endif /* PIKCHR_TCL */ |
| 8318 | |
| 8319 | |
| 8320 | #line 8320 "pikchr.c" |
| 8321 |
| --- extsrc/pikchr.c | |
| +++ extsrc/pikchr.c | |
| @@ -25,17 +25,17 @@ | |
| 25 | ** The following is the concatenation of all %include directives from the |
| 26 | ** input grammar file: |
| 27 | */ |
| 28 | /************ Begin %include sections from the grammar ************************/ |
| 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" |
| 33 | #define MANIFEST_YEAR "2025" |
| 34 | #define MANIFEST_ISODATE "20250319124121" |
| 35 | #define MANIFEST_NUMERIC_DATE 20250319 |
| 36 | #define MANIFEST_NUMERIC_TIME 124121 |
| 37 | #define RELEASE_VERSION "1.0" |
| 38 | #define RELEASE_VERSION_NUMBER 10000 |
| 39 | #define RELEASE_RESOURCE_VERSION 1,0,0,0 |
| 40 | #define COMPILER "gcc-13.3.0" |
| 41 | #line 2 "pikchr.y" |
| @@ -3687,15 +3687,15 @@ | |
| 3687 | ** than true arcs. Multiple reasons: (1) the legacy-PIC parameters |
| 3688 | ** that control arcs are obscure and I could not figure out what they |
| 3689 | ** mean based on available documentation. (2) Arcs are rarely used, |
| 3690 | ** and so do not seem that important. |
| 3691 | */ |
| 3692 | static PPoint arcControlPoint(int cw, PPoint f, PPoint t, PNum rScale, PNum rPct){ |
| 3693 | PPoint m; |
| 3694 | PNum dx, dy; |
| 3695 | m.x = rPct*(f.x+t.x); |
| 3696 | m.y = rPct*(f.y+t.y); |
| 3697 | dx = t.x - f.x; |
| 3698 | dy = t.y - f.y; |
| 3699 | if( cw ){ |
| 3700 | m.x -= 0.5*rScale*dy; |
| 3701 | m.y += 0.5*rScale*dx; |
| @@ -3709,20 +3709,22 @@ | |
| 3709 | PPoint m; |
| 3710 | if( p->nTPath>2 ){ |
| 3711 | pik_error(p, &pObj->errTok, "arc geometry error"); |
| 3712 | return; |
| 3713 | } |
| 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); |
| 3718 | } |
| 3719 | static void arcRender(Pik *p, PObj *pObj){ |
| 3720 | PPoint f, m, t; |
| 3721 | if( pObj->nPath<2 ) return; |
| 3722 | if( pObj->sw<0.0 ) return; |
| 3723 | f = pObj->aPath[0]; |
| 3724 | t = pObj->aPath[1]; |
| 3725 | m = arcControlPoint(pObj->cw,f,t,1.0,0.5); |
| 3726 | if( pObj->larrow ){ |
| 3727 | pik_draw_arrowhead(p,&m,&f,pObj); |
| 3728 | } |
| 3729 | if( pObj->rarrow ){ |
| 3730 | pik_draw_arrowhead(p,&m,&t,pObj); |
| @@ -8315,6 +8317,6 @@ | |
| 8317 | |
| 8318 | |
| 8319 | #endif /* PIKCHR_TCL */ |
| 8320 | |
| 8321 | |
| 8322 | #line 8322 "pikchr.c" |
| 8323 |