346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
|
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
|
-
+
|
PToken sIn; /* Input Pikchr-language text */
char *zOut; /* Result accumulates here */
unsigned int nOut; /* Bytes written to zOut[] so far */
unsigned int nOutAlloc; /* Space allocated to zOut[] */
unsigned char eDir; /* Current direction */
unsigned int mFlags; /* Flags passed to pikchr() */
PObj *cur; /* Object under construction */
PObj *lastRef; /* Last object references by "place" */
PObj *lastRef; /* Last object references by name */
PList *list; /* Object list under construction */
PMacro *pMacros; /* List of all defined macros */
PVar *pVar; /* Application-defined variables */
PBox bbox; /* Bounding box around all statements */
/* Cache of layout values. <=0.0 for unknown... */
PNum rScale; /* Multiply to convert inches to pixels */
PNum fontScale; /* Scale fonts by this percent */
|
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
|
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
|
-
+
|
UNUSED_PARAMETER(p);
}
static PPoint circleChop(Pik *p, PObj *pObj, PPoint *pPt){
PPoint chop;
PNum dx = pPt->x - pObj->ptAt.x;
PNum dy = pPt->y - pObj->ptAt.y;
PNum dist = hypot(dx,dy);
if( dist<pObj->rad ) return pObj->ptAt;
if( dist<pObj->rad || dist<=0 ) return pObj->ptAt;
chop.x = pObj->ptAt.x + dx*pObj->rad/dist;
chop.y = pObj->ptAt.y + dy*pObj->rad/dist;
UNUSED_PARAMETER(p);
return chop;
}
static void circleFit(Pik *p, PObj *pObj, PNum w, PNum h){
PNum mx = 0.0;
|
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
|
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
|
-
-
-
+
+
+
+
+
+
+
|
}
return 0;
}
/*
** There is a line traveling from pFrom to pTo.
**
** If point pTo is the exact enter of a choppable object,
** then adjust pTo by the appropriate amount in the direction
** of pFrom.
** If pObj is not null and is a choppable object, then chop at
** the boundary of pObj - where the line crosses the boundary
** of pObj.
**
** If pObj is NULL or has no xChop method, then search for some
** other object centered at pTo that is choppable and use it
** instead.
*/
static void pik_autochop(Pik *p, PPoint *pFrom, PPoint *pTo, PObj *pObj){
if( pObj==0 || pObj->type->xChop==0 ){
pObj = pik_find_chopper(p->list, pTo, pFrom);
}
if( pObj ){
*pTo = pObj->type->xChop(p, pObj, pFrom);
|
8075
8076
8077
8078
8079
8080
8081
8082
|
8079
8080
8081
8082
8083
8084
8085
8086
|
-
+
|
return TCL_OK;
}
#endif /* PIKCHR_TCL */
#line 8107 "pikchr.c"
#line 8111 "pikchr.c"
|