Back to index

tetex-bin  3.0
Functions
t1snap.c File Reference
#include "objects.h"
#include "spaces.h"
#include "paths.h"

Go to the source code of this file.

Functions

struct segmentt1_Phantom (struct xobject *obj)
struct xobjectt1_Snap (struct segment *p)

Function Documentation

struct segment* t1_Phantom ( struct xobject obj) [read]

Definition at line 43 of file t1snap.c.

{
       struct fractpoint pt; /* handle size will built here                  */
 
       if (obj == NULL)
               pt.x = pt.y = 0;
       else
               PathDelta(obj, &pt);
 
       return(PathSegment(MOVETYPE, pt.x, pt.y));
}
struct xobject* t1_Snap ( struct segment p) [read]

Definition at line 62 of file t1snap.c.

{
       struct fractpoint pt; /* for finding length of path                   */
 
       if (p == NULL)
               return(NULL);
       p = UniquePath(p);
 
       PathDelta(p, &pt);
       if (p->last->type == MOVETYPE) {
               p->last->dest.x -= pt.x;
               p->last->dest.y -= pt.y;
       }
       else
               p = JoinSegment(p, MOVETYPE, -pt.x, -pt.y, NULL);
       return((struct xobject *)p);
}