Fossil

Diff
Login

Differences From Artifact [430a5f8deb]:

To Artifact [d35a39f9cd]:


23
24
25
26
27
28
29
30
31
32



33
34
35
36



37
38
39
40
41
42
43
23
24
25
26
27
28
29



30
31
32
33



34
35
36
37
38
39
40
41
42
43







-
-
-
+
+
+

-
-
-
+
+
+







** source file.
**
** The following is the concatenation of all %include directives from the
** input grammar file:
*/
/************ Begin %include sections from the grammar ************************/
#line 1 "VERSION.h"
#define MANIFEST_UUID "052f07296e76ab2312caf2a4bf6237e574b3e533c7a36ee8f34db833baa3efb4"
#define MANIFEST_VERSION "[052f07296e]"
#define MANIFEST_DATE "2025-03-05 10:54:16"
#define MANIFEST_UUID "9b9b3133644ff804f8312bb839ad4eb43d1eb1869558f7a3a50b788b2c4a706a"
#define MANIFEST_VERSION "[9b9b313364]"
#define MANIFEST_DATE "2025-03-19 12:41:21"
#define MANIFEST_YEAR "2025"
#define MANIFEST_ISODATE "20250305105416"
#define MANIFEST_NUMERIC_DATE 20250305
#define MANIFEST_NUMERIC_TIME 105416
#define MANIFEST_ISODATE "20250319124121"
#define MANIFEST_NUMERIC_DATE 20250319
#define MANIFEST_NUMERIC_TIME 124121
#define RELEASE_VERSION "1.0"
#define RELEASE_VERSION_NUMBER 10000
#define RELEASE_RESOURCE_VERSION 1,0,0,0
#define COMPILER "gcc-13.3.0"
#line 2 "pikchr.y"

/*
3685
3686
3687
3688
3689
3690
3691
3692

3693
3694
3695
3696


3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714



3715
3716
3717
3718
3719
3720
3721
3722
3723

3724
3725
3726
3727
3728
3729
3730
3685
3686
3687
3688
3689
3690
3691

3692
3693
3694


3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713

3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724

3725
3726
3727
3728
3729
3730
3731
3732







-
+


-
-
+
+

















-
+
+
+








-
+







}
/* Hack: Arcs are here rendered as quadratic Bezier curves rather
** than true arcs.  Multiple reasons: (1) the legacy-PIC parameters
** that control arcs are obscure and I could not figure out what they
** mean based on available documentation.  (2) Arcs are rarely used,
** and so do not seem that important.
*/
static PPoint arcControlPoint(int cw, PPoint f, PPoint t, PNum rScale){
static PPoint arcControlPoint(int cw, PPoint f, PPoint t, PNum rScale, PNum rPct){
  PPoint m;
  PNum dx, dy;
  m.x = 0.5*(f.x+t.x);
  m.y = 0.5*(f.y+t.y);
  m.x = rPct*(f.x+t.x);
  m.y = rPct*(f.y+t.y);
  dx = t.x - f.x;
  dy = t.y - f.y;
  if( cw ){
    m.x -= 0.5*rScale*dy;
    m.y += 0.5*rScale*dx;
  }else{
    m.x += 0.5*rScale*dy;
    m.y -= 0.5*rScale*dx;
  }
  return m;
}
static void arcCheck(Pik *p, PObj *pObj){
  PPoint m;
  if( p->nTPath>2 ){
    pik_error(p, &pObj->errTok, "arc geometry error");
    return;
  }
  m = arcControlPoint(pObj->cw, p->aTPath[0], p->aTPath[1], 0.5);
  m = arcControlPoint(pObj->cw, p->aTPath[0], p->aTPath[1], 0.5, 0.25);
  pik_bbox_add_xy(&pObj->bbox, m.x, m.y);
  m = arcControlPoint(pObj->cw, p->aTPath[0], p->aTPath[1], 0.5, 0.75);
  pik_bbox_add_xy(&pObj->bbox, m.x, m.y);
}
static void arcRender(Pik *p, PObj *pObj){
  PPoint f, m, t;
  if( pObj->nPath<2 ) return;
  if( pObj->sw<0.0 ) return;
  f = pObj->aPath[0];
  t = pObj->aPath[1];
  m = arcControlPoint(pObj->cw,f,t,1.0);
  m = arcControlPoint(pObj->cw,f,t,1.0,0.5);
  if( pObj->larrow ){
    pik_draw_arrowhead(p,&m,&f,pObj);
  }
  if( pObj->rarrow ){
    pik_draw_arrowhead(p,&m,&t,pObj);
  }
  pik_append_xy(p,"<path d=\"M", f.x, f.y);
8313
8314
8315
8316
8317
8318
8319
8320

8315
8316
8317
8318
8319
8320
8321

8322







-
+
  return TCL_OK;
}


#endif /* PIKCHR_TCL */


#line 8320 "pikchr.c"
#line 8322 "pikchr.c"