| pathforall |
(Function moveto, Function lineto, Function quadto, Function curveto, Function closepath) |
typedict.Path |
| |
Walks through this path and calls the
moveto,
lineto,
quadto,
curveto,
or
closepath
function, if it is not
NULL,
that corresponds to each path element that is encountered.
Each function is called with the exact arguments that the corresponding
moveto,
lineto,
quadto,
curveto,
or
closepath
built-in would use to duplicate the existing path, which means numbers are
in the user space described by the
CTM
associated with this path when
pathforall
is called.
| |
| 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);
closepath() = printf(" closepath();\n");
p.moveto(100, 200);
p.rlineto(100, 0);
p.rlineto(0, 200);
p.closepath();
printf("Output before CTM change:\n");
p.pathforall(moveto, lineto, NULL, NULL, closepath);
p.CTM.scale(2, 2);
printf("\nOutput after CTM change:\n");
p.pathforall(moveto, lineto, NULL, NULL, closepath);
prints something like
Output before CTM change:
moveto(100.0, 200.0);
lineto(200.0, 200.0);
lineto(200.0, 400.0);
closepath();
Output after CTM change:
moveto(50.0, 100.0);
lineto(100.0, 100.0);
lineto(100.0, 200.0);
closepath();
on standard output.
Notice how the coordinates changed after we scaled the
CTM
associated with the path.
| | |
| Return: |
none
| | |
| See Also: |
arc,
arcn,
closepath,
currentpath,
currentpoint,
curveto,
flattenpath,
Graphics,
lineto,
moveto,
newpath,
pathbbox,
quadto,
rcurveto,
rlineto,
rmoveto,
rquadto
|
|
Yoix is a registered trademark of AT&T Inc.
|
|