Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | New pikchr.c that fixes an additional problem with "to" terms on line paths and that ensures that "dot" objects to not change the exit point. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
863d272205172935214f12bb14ad5ea1 |
| User & Date: | drh 2020-09-14 17:03:50.074 |
Context
|
2020-09-14
| ||
| 21:40 | pikchrshow: corrected clipboard copy contents for raw SVG mode (it was including containing DIV element). check-in: bb56d3d5a2 user: stephan tags: trunk | |
| 17:03 | New pikchr.c that fixes an additional problem with "to" terms on line paths and that ensures that "dot" objects to not change the exit point. check-in: 863d272205 user: drh tags: trunk | |
| 16:29 | New pikchr.c fixes an issue with handling of the "to" phrase on a line that already has an incomplete direction add. check-in: 868c38e361 user: drh tags: trunk | |
Changes
Changes to src/pikchr.c.
| ︙ | ︙ | |||
3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 |
case T_COLOR:
pElem->fill = pElem->color;
break;
case T_FILL:
pElem->color = pElem->fill;
break;
}
}
static void dotRender(Pik *p, PElem *pElem){
PNum r = pElem->rad;
PPoint pt = pElem->ptAt;
if( pElem->sw>0.0 ){
pik_append_x(p,"<circle cx=\"", pt.x, "\"");
pik_append_y(p," cy=\"", pt.y, "\"");
| > > > > > > > > > > | 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 |
case T_COLOR:
pElem->fill = pElem->color;
break;
case T_FILL:
pElem->color = pElem->fill;
break;
}
}
static void dotCheck(Pik *p, PElem *pElem){
pElem->w = pElem->h = 0;
pik_bbox_addellipse(&pElem->bbox, pElem->ptAt.x, pElem->ptAt.y,
pElem->rad, pElem->rad);
}
static PPoint dotOffset(Pik *p, PElem *pElem, int cp){
PPoint zero;
zero.x = zero.y = 0;
return zero;
}
static void dotRender(Pik *p, PElem *pElem){
PNum r = pElem->rad;
PPoint pt = pElem->ptAt;
if( pElem->sw>0.0 ){
pik_append_x(p,"<circle cx=\"", pt.x, "\"");
pik_append_y(p," cy=\"", pt.y, "\"");
|
| ︙ | ︙ | |||
4153 4154 4155 4156 4157 4158 4159 |
/* xRender */ cylinderRender
},
{ /* name */ "dot",
/* isline */ 0,
/* eJust */ 0,
/* xInit */ dotInit,
/* xNumProp */ dotNumProp,
| | | | 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 |
/* xRender */ cylinderRender
},
{ /* name */ "dot",
/* isline */ 0,
/* eJust */ 0,
/* xInit */ dotInit,
/* xNumProp */ dotNumProp,
/* xCheck */ dotCheck,
/* xChop */ circleChop,
/* xOffset */ dotOffset,
/* xFit */ 0,
/* xRender */ dotRender
},
{ /* name */ "ellipse",
/* isline */ 0,
/* eJust */ 0,
/* xInit */ ellipseInit,
|
| ︙ | ︙ | |||
5411 5412 5413 5414 5415 5416 5417 |
pik_error(p, pTk, "use \"at\" to position this object");
return;
}
if( pElem->bClose ){
pik_error(p, pTk, "polygon is closed");
return;
}
| | | 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 |
pik_error(p, pTk, "use \"at\" to position this object");
return;
}
if( pElem->bClose ){
pik_error(p, pTk, "polygon is closed");
return;
}
if( n==0 || p->mTPath==3 || p->thenFlag ){
n = pik_next_rpath(p, pTk);
}
p->aTPath[n] = *pPt;
p->mTPath = 3;
}
static void pik_close_path(Pik *p, PToken *pErr){
|
| ︙ | ︙ | |||
6080 6081 6082 6083 6084 6085 6086 | int i; PPoint ofst; PNum dx, dy; if( p->nErr ) return; /* Position block elements */ | > | | | | | > | 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 |
int i;
PPoint ofst;
PNum dx, dy;
if( p->nErr ) return;
/* Position block elements */
if( pElem->type->isLine==0 ){
ofst = pik_elem_offset(p, pElem, pElem->eWith);
dx = (pElem->with.x - ofst.x) - pElem->ptAt.x;
dy = (pElem->with.y - ofst.y) - pElem->ptAt.y;
if( dx!=0 || dy!=0 ){
pik_elem_move(pElem, dx, dy);
}
}
/* For a line object with no movement specified, a single movement
** of the default length in the current direction
*/
if( pElem->type->isLine && p->nTPath<2 ){
pik_next_rpath(p, 0);
|
| ︙ | ︙ | |||
6184 6185 6186 6187 6188 6189 6190 |
}
switch( pElem->outDir ){
default: pElem->ptExit.x += w2; break;
case DIR_LEFT: pElem->ptExit.x -= w2; break;
case DIR_UP: pElem->ptExit.y += h2; break;
case DIR_DOWN: pElem->ptExit.y -= h2; break;
}
| | < | < | 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 |
}
switch( pElem->outDir ){
default: pElem->ptExit.x += w2; break;
case DIR_LEFT: pElem->ptExit.x -= w2; break;
case DIR_UP: pElem->ptExit.y += h2; break;
case DIR_DOWN: pElem->ptExit.y -= h2; break;
}
pik_bbox_add_xy(&pElem->bbox, pElem->ptAt.x - w2, pElem->ptAt.y - h2);
pik_bbox_add_xy(&pElem->bbox, pElem->ptAt.x + w2, pElem->ptAt.y + h2);
}
p->eDir = pElem->outDir;
}
/* Show basic information about each element as a comment in the
** generated HTML. Used for testing and debugging. Activated
** by the (undocumented) "debug = 1;"
|
| ︙ | ︙ | |||
6987 6988 6989 6990 6991 6992 6993 |
}
}
printf("</body></html>\n");
return 0;
}
#endif /* PIKCHR_SHELL */
| | | 6997 6998 6999 7000 7001 7002 7003 7004 |
}
}
printf("</body></html>\n");
return 0;
}
#endif /* PIKCHR_SHELL */
#line 7029 "pikchr.c"
|