Fossil SCM

Update the built-in Pikchr to the latest version that fixes the issue with bounding boxes on rotated arcs.

drh 2025-03-19 12:43 trunk
Commit 91dabe4b35ac3066e0bd09d399023f89a2d825deebfe2828392e24cc55eb9b18
1 file changed +14 -12
+14 -12
--- extsrc/pikchr.c
+++ extsrc/pikchr.c
@@ -25,17 +25,17 @@
2525
** The following is the concatenation of all %include directives from the
2626
** input grammar file:
2727
*/
2828
/************ Begin %include sections from the grammar ************************/
2929
#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"
3333
#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
3737
#define RELEASE_VERSION "1.0"
3838
#define RELEASE_VERSION_NUMBER 10000
3939
#define RELEASE_RESOURCE_VERSION 1,0,0,0
4040
#define COMPILER "gcc-13.3.0"
4141
#line 2 "pikchr.y"
@@ -3687,15 +3687,15 @@
36873687
** than true arcs. Multiple reasons: (1) the legacy-PIC parameters
36883688
** that control arcs are obscure and I could not figure out what they
36893689
** mean based on available documentation. (2) Arcs are rarely used,
36903690
** and so do not seem that important.
36913691
*/
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){
36933693
PPoint m;
36943694
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);
36973697
dx = t.x - f.x;
36983698
dy = t.y - f.y;
36993699
if( cw ){
37003700
m.x -= 0.5*rScale*dy;
37013701
m.y += 0.5*rScale*dx;
@@ -3709,20 +3709,22 @@
37093709
PPoint m;
37103710
if( p->nTPath>2 ){
37113711
pik_error(p, &pObj->errTok, "arc geometry error");
37123712
return;
37133713
}
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);
37153717
pik_bbox_add_xy(&pObj->bbox, m.x, m.y);
37163718
}
37173719
static void arcRender(Pik *p, PObj *pObj){
37183720
PPoint f, m, t;
37193721
if( pObj->nPath<2 ) return;
37203722
if( pObj->sw<0.0 ) return;
37213723
f = pObj->aPath[0];
37223724
t = pObj->aPath[1];
3723
- m = arcControlPoint(pObj->cw,f,t,1.0);
3725
+ m = arcControlPoint(pObj->cw,f,t,1.0,0.5);
37243726
if( pObj->larrow ){
37253727
pik_draw_arrowhead(p,&m,&f,pObj);
37263728
}
37273729
if( pObj->rarrow ){
37283730
pik_draw_arrowhead(p,&m,&t,pObj);
@@ -8315,6 +8317,6 @@
83158317
83168318
83178319
#endif /* PIKCHR_TCL */
83188320
83198321
8320
-#line 8320 "pikchr.c"
8322
+#line 8322 "pikchr.c"
83218323
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button