| add |
(Object rhs [, int rule]) |
typedict.Path |
| |
Adds the area covered by this path to the area covered by
rhs,
which must be a
Path,
Rectangle,
or
NULL,
replaces this path by a new one whose interior represents the result,
and returns this path to the caller.
By default, interior points in both paths are identified using the
non-zero winding rule, but setting the optional
rule
argument to
WIND_EVEN_ODD,
which is defined in
yoix.graphics,
means the even-odd winding rule will be used to identify the interior of
rhs.
| |
| Example: |
The program,
import yoix.*.*;
Path p1;
Path p2;
Path p3;
p2 { // "named block"
moveto(72, 72);
rlineto(72, 0);
rlineto(0, 72);
closepath();
};
p3 { // "named block"
moveto(144 - 18, 72 + 18);
rlineto(72, 0);
rlineto(0, 72);
closepath();
};
p1.add(p2).add(p3);
JFrame f = {
paint(Rectangle rect) {
graphics { // "named block"
setpath(p1);
setrgbcolor(0, 0, 1);
fill();
setpath(p1);
setrgbcolor(1, 0, 0);
stroke();
}
}
};
f.visible = TRUE;
uses
add
to build a new path from separate triangular paths and displays the
result in a frame that defines a paint function that fills and strokes
the new path.
| | |
| Return: |
Path
| | |
| See Also: |
eoadd,
eointersect,
eosubtract,
eoxor,
intersect,
subtract,
xor
|
|
Yoix is a registered trademark of AT&T Inc.
|