| lineto |
(Number x, Number y) |
typedict.Path |
| |
Adds a line segment to this path that extends from the current point,
if there is one, to
(x, y),
which becomes the new current point.
The point
(x, y)
is transformed using the
CTM
associated with this path when
lineto
is called, which means subsequent changes to
CTM
do not affect this line segment.
If this path is empty
lineto
will abort with a
nocurrentpoint
error.
| |
| Example: |
The program,
import yoix.stdio.*;
Path p;
moveto(x, y) = printf(" moveto(%.1f, %.1f);\n", x, y);
lineto(x, y) = printf(" lineto(%.1f, %.1f);\n", x, y);
p.moveto(100, 200);
p.lineto(200, 400);
p.lineto(200, 300);
printf("Output before CTM change:\n");
p.pathforall(moveto, lineto, NULL, NULL, NULL);
p.CTM.scale(2, 2);
printf("\nOutput after CTM change:\n");
p.pathforall(moveto, lineto, NULL, NULL, NULL);
prints something like
Output before CTM change:
moveto(100.0, 200.0);
lineto(200.0, 400.0);
lineto(200.0, 300.0);
Output after CTM change:
moveto(50.0, 100.0);
lineto(100.0, 200.0);
lineto(100.0, 150.0);
on standard output.
Notice how the coordinates changed after we scaled the
CTM
associated with the path.
| | |
| Return: |
Path
| | |
| See Also: |
arc,
arcn,
closepath,
currentpath,
currentpoint,
curveto,
flattenpath,
Graphics,
moveto,
newpath,
pathbbox,
pathforall,
quadto,
rcurveto,
rlineto,
rmoveto,
rquadto
|
|
Yoix is a registered trademark of AT&T Inc.
|
|