1 /* $XConsortium: t1snap.c,v 1.3 91/10/10 11:19:47 rws Exp $ */
2 /* Copyright International Business Machines,Corp. 1991
5 * License to use, copy, modify, and distribute this software
6 * and its documentation for any purpose and without fee is
7 * hereby granted, provided that the above copyright notice
8 * appear in all copies and that both that copyright notice and
9 * this permission notice appear in supporting documentation,
10 * and that the name of IBM not be used in advertising or
11 * publicity pertaining to distribution of the software without
12 * specific, written prior permission.
14 * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
15 * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
16 * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
18 * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND
19 * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
20 * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF
21 * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
22 * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN
23 * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
24 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
25 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
26 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
27 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
38 :h3.Phantom() - Returns a Move Segment Equivalent to Handles
40 This is a user operator. Its new name is QueryHandle.
43 struct segment *t1_Phantom(obj)
44 register struct xobject *obj; /* object to take the Phantom of */
46 struct fractpoint pt; /* handle size will built here */
53 return(PathSegment(MOVETYPE, pt.x, pt.y));
57 :h3.Snap() - Force Ending Handle of Object to Origin
59 This is a user operator.
62 struct xobject *t1_Snap(p)
63 register struct segment *p; /* path to snap */
65 struct fractpoint pt; /* for finding length of path */
72 if (p->last->type == MOVETYPE) {
73 p->last->dest.x -= pt.x;
74 p->last->dest.y -= pt.y;
77 p = JoinSegment(p, MOVETYPE, -pt.x, -pt.y, NULL);
78 return((struct xobject *)p);