Fossil SCM
Update pikchr.c to the latest. This also required a small correction to text alignment in figure 6 of branching.wiki
Commit
c3bb7cd22a8dde6fdb33be159192b24d477232a5d9b59a49c942b7c6efb41ec7
Parent
be99269dc3ffb06…
2 files changed
+12
-6
+2
-2
+12
-6
| --- src/pikchr.c | ||
| +++ src/pikchr.c | ||
| @@ -3877,12 +3877,12 @@ | ||
| 3877 | 3877 | } |
| 3878 | 3878 | |
| 3879 | 3879 | |
| 3880 | 3880 | /* Methods for the "text" class */ |
| 3881 | 3881 | static void textInit(Pik *p, PElem *pElem){ |
| 3882 | - pElem->w = pik_value(p, "textwid",7,0); | |
| 3883 | - pElem->h = pik_value(p, "textht",6,0); | |
| 3882 | + pik_value(p, "textwid",7,0); | |
| 3883 | + pik_value(p, "textht",6,0); | |
| 3884 | 3884 | pElem->sw = 0.0; |
| 3885 | 3885 | } |
| 3886 | 3886 | |
| 3887 | 3887 | /* Methods for the "sublist" class */ |
| 3888 | 3888 | static void sublistInit(Pik *p, PElem *pElem){ |
| @@ -4030,11 +4030,11 @@ | ||
| 4030 | 4030 | /* eJust */ 0, |
| 4031 | 4031 | /* xInit */ textInit, |
| 4032 | 4032 | /* xNumProp */ 0, |
| 4033 | 4033 | /* xChop */ boxChop, |
| 4034 | 4034 | /* xOffset */ boxOffset, |
| 4035 | - /* xFit */ 0, | |
| 4035 | + /* xFit */ boxFit, | |
| 4036 | 4036 | /* xRender */ boxRender |
| 4037 | 4037 | }, |
| 4038 | 4038 | }; |
| 4039 | 4039 | static const PClass sublistClass = |
| 4040 | 4040 | { /* name */ "[]", |
| @@ -5478,11 +5478,11 @@ | ||
| 5478 | 5478 | ** element, then throw an error. |
| 5479 | 5479 | ** |
| 5480 | 5480 | ** The pNth token describes the N-th search. The pNth->eCode value |
| 5481 | 5481 | ** is one more than the number of items to skip. It is negative |
| 5482 | 5482 | ** to search backwards. If pNth->eType==T_ID, then it is the name |
| 5483 | -** of a primative time to search for. If pNth->eType==T_LB, then | |
| 5483 | +** of a class to search for. If pNth->eType==T_LB, then | |
| 5484 | 5484 | ** search for a [] object. If pNth->eType==T_LAST, then search for |
| 5485 | 5485 | ** any type. |
| 5486 | 5486 | ** |
| 5487 | 5487 | ** Raise an error if the item is not found. |
| 5488 | 5488 | */ |
| @@ -5841,10 +5841,15 @@ | ||
| 5841 | 5841 | case DIR_LEFT: p->aTPath[1].x -= pElem->w; break; |
| 5842 | 5842 | case DIR_UP: p->aTPath[1].y += pElem->h; break; |
| 5843 | 5843 | } |
| 5844 | 5844 | } |
| 5845 | 5845 | } |
| 5846 | + | |
| 5847 | + /* Run "fit" on the text type automatically */ | |
| 5848 | + if( pElem->type->xInit==textInit && pElem->nTxt ){ | |
| 5849 | + pik_size_to_fit(p, &pElem->errTok); | |
| 5850 | + } | |
| 5846 | 5851 | |
| 5847 | 5852 | /* Compute final bounding box, entry and exit points, center |
| 5848 | 5853 | ** point (ptAt) and path for the element |
| 5849 | 5854 | */ |
| 5850 | 5855 | pik_bbox_init(&pElem->bbox); |
| @@ -5986,11 +5991,11 @@ | ||
| 5986 | 5991 | */ |
| 5987 | 5992 | static void pik_bbox_add_elist(Pik *p, PEList *pEList, PNum wArrow){ |
| 5988 | 5993 | int i; |
| 5989 | 5994 | for(i=0; i<pEList->n; i++){ |
| 5990 | 5995 | PElem *pElem = pEList->a[i]; |
| 5991 | - pik_bbox_addbox(&p->bbox, &pElem->bbox); | |
| 5996 | + if( pElem->sw>0.0 ) pik_bbox_addbox(&p->bbox, &pElem->bbox); | |
| 5992 | 5997 | pik_append_txt(p, pElem, &p->bbox); |
| 5993 | 5998 | if( pElem->pSublist ) pik_bbox_add_elist(p, pElem->pSublist, wArrow); |
| 5994 | 5999 | |
| 5995 | 6000 | |
| 5996 | 6001 | /* Expand the bounding box to account for arrowheads on lines */ |
| @@ -6150,10 +6155,11 @@ | ||
| 6150 | 6155 | { "n", 1, T_EDGEPT, 0, CP_N }, |
| 6151 | 6156 | { "ne", 2, T_EDGEPT, 0, CP_NE }, |
| 6152 | 6157 | { "north", 5, T_EDGEPT, 0, CP_N }, |
| 6153 | 6158 | { "nw", 2, T_EDGEPT, 0, CP_NW }, |
| 6154 | 6159 | { "of", 2, T_OF, 0, 0 }, |
| 6160 | + { "previous", 8, T_LAST, 0, 0, }, | |
| 6155 | 6161 | { "print", 5, T_PRINT, 0, 0 }, |
| 6156 | 6162 | { "rad", 3, T_RADIUS, 0, 0 }, |
| 6157 | 6163 | { "radius", 6, T_RADIUS, 0, 0 }, |
| 6158 | 6164 | { "right", 5, T_RIGHT, DIR_RIGHT, CP_E }, |
| 6159 | 6165 | { "rjust", 5, T_RJUST, 0, 0 }, |
| @@ -6657,6 +6663,6 @@ | ||
| 6657 | 6663 | printf("</body></html>\n"); |
| 6658 | 6664 | return 0; |
| 6659 | 6665 | } |
| 6660 | 6666 | #endif /* PIKCHR_SHELL */ |
| 6661 | 6667 | |
| 6662 | -#line 6687 "pikchr.c" | |
| 6668 | +#line 6693 "pikchr.c" | |
| 6663 | 6669 |
| --- src/pikchr.c | |
| +++ src/pikchr.c | |
| @@ -3877,12 +3877,12 @@ | |
| 3877 | } |
| 3878 | |
| 3879 | |
| 3880 | /* Methods for the "text" class */ |
| 3881 | static void textInit(Pik *p, PElem *pElem){ |
| 3882 | pElem->w = pik_value(p, "textwid",7,0); |
| 3883 | pElem->h = pik_value(p, "textht",6,0); |
| 3884 | pElem->sw = 0.0; |
| 3885 | } |
| 3886 | |
| 3887 | /* Methods for the "sublist" class */ |
| 3888 | static void sublistInit(Pik *p, PElem *pElem){ |
| @@ -4030,11 +4030,11 @@ | |
| 4030 | /* eJust */ 0, |
| 4031 | /* xInit */ textInit, |
| 4032 | /* xNumProp */ 0, |
| 4033 | /* xChop */ boxChop, |
| 4034 | /* xOffset */ boxOffset, |
| 4035 | /* xFit */ 0, |
| 4036 | /* xRender */ boxRender |
| 4037 | }, |
| 4038 | }; |
| 4039 | static const PClass sublistClass = |
| 4040 | { /* name */ "[]", |
| @@ -5478,11 +5478,11 @@ | |
| 5478 | ** element, then throw an error. |
| 5479 | ** |
| 5480 | ** The pNth token describes the N-th search. The pNth->eCode value |
| 5481 | ** is one more than the number of items to skip. It is negative |
| 5482 | ** to search backwards. If pNth->eType==T_ID, then it is the name |
| 5483 | ** of a primative time to search for. If pNth->eType==T_LB, then |
| 5484 | ** search for a [] object. If pNth->eType==T_LAST, then search for |
| 5485 | ** any type. |
| 5486 | ** |
| 5487 | ** Raise an error if the item is not found. |
| 5488 | */ |
| @@ -5841,10 +5841,15 @@ | |
| 5841 | case DIR_LEFT: p->aTPath[1].x -= pElem->w; break; |
| 5842 | case DIR_UP: p->aTPath[1].y += pElem->h; break; |
| 5843 | } |
| 5844 | } |
| 5845 | } |
| 5846 | |
| 5847 | /* Compute final bounding box, entry and exit points, center |
| 5848 | ** point (ptAt) and path for the element |
| 5849 | */ |
| 5850 | pik_bbox_init(&pElem->bbox); |
| @@ -5986,11 +5991,11 @@ | |
| 5986 | */ |
| 5987 | static void pik_bbox_add_elist(Pik *p, PEList *pEList, PNum wArrow){ |
| 5988 | int i; |
| 5989 | for(i=0; i<pEList->n; i++){ |
| 5990 | PElem *pElem = pEList->a[i]; |
| 5991 | pik_bbox_addbox(&p->bbox, &pElem->bbox); |
| 5992 | pik_append_txt(p, pElem, &p->bbox); |
| 5993 | if( pElem->pSublist ) pik_bbox_add_elist(p, pElem->pSublist, wArrow); |
| 5994 | |
| 5995 | |
| 5996 | /* Expand the bounding box to account for arrowheads on lines */ |
| @@ -6150,10 +6155,11 @@ | |
| 6150 | { "n", 1, T_EDGEPT, 0, CP_N }, |
| 6151 | { "ne", 2, T_EDGEPT, 0, CP_NE }, |
| 6152 | { "north", 5, T_EDGEPT, 0, CP_N }, |
| 6153 | { "nw", 2, T_EDGEPT, 0, CP_NW }, |
| 6154 | { "of", 2, T_OF, 0, 0 }, |
| 6155 | { "print", 5, T_PRINT, 0, 0 }, |
| 6156 | { "rad", 3, T_RADIUS, 0, 0 }, |
| 6157 | { "radius", 6, T_RADIUS, 0, 0 }, |
| 6158 | { "right", 5, T_RIGHT, DIR_RIGHT, CP_E }, |
| 6159 | { "rjust", 5, T_RJUST, 0, 0 }, |
| @@ -6657,6 +6663,6 @@ | |
| 6657 | printf("</body></html>\n"); |
| 6658 | return 0; |
| 6659 | } |
| 6660 | #endif /* PIKCHR_SHELL */ |
| 6661 | |
| 6662 | #line 6687 "pikchr.c" |
| 6663 |
| --- src/pikchr.c | |
| +++ src/pikchr.c | |
| @@ -3877,12 +3877,12 @@ | |
| 3877 | } |
| 3878 | |
| 3879 | |
| 3880 | /* Methods for the "text" class */ |
| 3881 | static void textInit(Pik *p, PElem *pElem){ |
| 3882 | pik_value(p, "textwid",7,0); |
| 3883 | pik_value(p, "textht",6,0); |
| 3884 | pElem->sw = 0.0; |
| 3885 | } |
| 3886 | |
| 3887 | /* Methods for the "sublist" class */ |
| 3888 | static void sublistInit(Pik *p, PElem *pElem){ |
| @@ -4030,11 +4030,11 @@ | |
| 4030 | /* eJust */ 0, |
| 4031 | /* xInit */ textInit, |
| 4032 | /* xNumProp */ 0, |
| 4033 | /* xChop */ boxChop, |
| 4034 | /* xOffset */ boxOffset, |
| 4035 | /* xFit */ boxFit, |
| 4036 | /* xRender */ boxRender |
| 4037 | }, |
| 4038 | }; |
| 4039 | static const PClass sublistClass = |
| 4040 | { /* name */ "[]", |
| @@ -5478,11 +5478,11 @@ | |
| 5478 | ** element, then throw an error. |
| 5479 | ** |
| 5480 | ** The pNth token describes the N-th search. The pNth->eCode value |
| 5481 | ** is one more than the number of items to skip. It is negative |
| 5482 | ** to search backwards. If pNth->eType==T_ID, then it is the name |
| 5483 | ** of a class to search for. If pNth->eType==T_LB, then |
| 5484 | ** search for a [] object. If pNth->eType==T_LAST, then search for |
| 5485 | ** any type. |
| 5486 | ** |
| 5487 | ** Raise an error if the item is not found. |
| 5488 | */ |
| @@ -5841,10 +5841,15 @@ | |
| 5841 | case DIR_LEFT: p->aTPath[1].x -= pElem->w; break; |
| 5842 | case DIR_UP: p->aTPath[1].y += pElem->h; break; |
| 5843 | } |
| 5844 | } |
| 5845 | } |
| 5846 | |
| 5847 | /* Run "fit" on the text type automatically */ |
| 5848 | if( pElem->type->xInit==textInit && pElem->nTxt ){ |
| 5849 | pik_size_to_fit(p, &pElem->errTok); |
| 5850 | } |
| 5851 | |
| 5852 | /* Compute final bounding box, entry and exit points, center |
| 5853 | ** point (ptAt) and path for the element |
| 5854 | */ |
| 5855 | pik_bbox_init(&pElem->bbox); |
| @@ -5986,11 +5991,11 @@ | |
| 5991 | */ |
| 5992 | static void pik_bbox_add_elist(Pik *p, PEList *pEList, PNum wArrow){ |
| 5993 | int i; |
| 5994 | for(i=0; i<pEList->n; i++){ |
| 5995 | PElem *pElem = pEList->a[i]; |
| 5996 | if( pElem->sw>0.0 ) pik_bbox_addbox(&p->bbox, &pElem->bbox); |
| 5997 | pik_append_txt(p, pElem, &p->bbox); |
| 5998 | if( pElem->pSublist ) pik_bbox_add_elist(p, pElem->pSublist, wArrow); |
| 5999 | |
| 6000 | |
| 6001 | /* Expand the bounding box to account for arrowheads on lines */ |
| @@ -6150,10 +6155,11 @@ | |
| 6155 | { "n", 1, T_EDGEPT, 0, CP_N }, |
| 6156 | { "ne", 2, T_EDGEPT, 0, CP_NE }, |
| 6157 | { "north", 5, T_EDGEPT, 0, CP_N }, |
| 6158 | { "nw", 2, T_EDGEPT, 0, CP_NW }, |
| 6159 | { "of", 2, T_OF, 0, 0 }, |
| 6160 | { "previous", 8, T_LAST, 0, 0, }, |
| 6161 | { "print", 5, T_PRINT, 0, 0 }, |
| 6162 | { "rad", 3, T_RADIUS, 0, 0 }, |
| 6163 | { "radius", 6, T_RADIUS, 0, 0 }, |
| 6164 | { "right", 5, T_RIGHT, DIR_RIGHT, CP_E }, |
| 6165 | { "rjust", 5, T_RJUST, 0, 0 }, |
| @@ -6657,6 +6663,6 @@ | |
| 6663 | printf("</body></html>\n"); |
| 6664 | return 0; |
| 6665 | } |
| 6666 | #endif /* PIKCHR_SHELL */ |
| 6667 | |
| 6668 | #line 6693 "pikchr.c" |
| 6669 |
+2
-2
| --- www/branching.wiki | ||
| +++ www/branching.wiki | ||
| @@ -538,13 +538,13 @@ | ||
| 538 | 538 | C1: circle same as A1 at B1-(0,$laneh) "1" |
| 539 | 539 | arrow 50% |
| 540 | 540 | circle same "2" |
| 541 | 541 | arrow right 0.8in "goes" "offline" |
| 542 | 542 | C5: circle same as A3 "5" |
| 543 | - arrow right until even with first ellipse.w | |
| 543 | + arrow right until even with first ellipse.w \ | |
| 544 | + "back online" above "pushes 5" below "pulls 3 & 4" below | |
| 544 | 545 | ellipse same "future" |
| 545 | - text "back online" "pushes 5" "pulls 3 & 4" with .n at last arrow | |
| 546 | 546 | |
| 547 | 547 | # content for the Darlene lane |
| 548 | 548 | D1: circle same as A1 at C1-(0,$laneh) "1" |
| 549 | 549 | arrow 50% |
| 550 | 550 | circle same "2" |
| 551 | 551 |
| --- www/branching.wiki | |
| +++ www/branching.wiki | |
| @@ -538,13 +538,13 @@ | |
| 538 | C1: circle same as A1 at B1-(0,$laneh) "1" |
| 539 | arrow 50% |
| 540 | circle same "2" |
| 541 | arrow right 0.8in "goes" "offline" |
| 542 | C5: circle same as A3 "5" |
| 543 | arrow right until even with first ellipse.w |
| 544 | ellipse same "future" |
| 545 | text "back online" "pushes 5" "pulls 3 & 4" with .n at last arrow |
| 546 | |
| 547 | # content for the Darlene lane |
| 548 | D1: circle same as A1 at C1-(0,$laneh) "1" |
| 549 | arrow 50% |
| 550 | circle same "2" |
| 551 |
| --- www/branching.wiki | |
| +++ www/branching.wiki | |
| @@ -538,13 +538,13 @@ | |
| 538 | C1: circle same as A1 at B1-(0,$laneh) "1" |
| 539 | arrow 50% |
| 540 | circle same "2" |
| 541 | arrow right 0.8in "goes" "offline" |
| 542 | C5: circle same as A3 "5" |
| 543 | arrow right until even with first ellipse.w \ |
| 544 | "back online" above "pushes 5" below "pulls 3 & 4" below |
| 545 | ellipse same "future" |
| 546 | |
| 547 | # content for the Darlene lane |
| 548 | D1: circle same as A1 at C1-(0,$laneh) "1" |
| 549 | arrow 50% |
| 550 | circle same "2" |
| 551 |