| ineofill |
(Point p) |
typedict.Path |
| ineofill |
(Number x, Number y) |
|
| |
Returns non-zero if
p
or the point
(x, y)
lies inside this path, as determined by the even-odd winding rule,
and non-zero otherwise.
| |
| Example: |
The program,
import yoix.*.*;
JFrame f = {
paint() {
graphics { // "named block"
if (currentpoint() == NULL) {
scale(2, 2);
translate(72, 72);
moveto(0, 0);
curveto(144, 0, 72, 72, 36, 36);
curveto(72, 0, 144, 72, 0, 72);
closepath();
}
gsave();
eofill();
grestore();
}
}
mousePressed(MouseEvent e) {
printf("hit=%d\n", graphics.path.ineofill(e.coordinates));
}
};
f.visible = TRUE;
defines a paint function in a frame that builds a simple path in a
transformed coordinate system, fills it using
eofill,
and then uses
ineofill
in to decide if a button was pressed when the cursor was inside the path.
Notice that we used
e.coordinates
rather than
e.location
in the event handler.
Both values are defined and can be identical, but
e.location
always represents the location of the event in the Yoix default
coordinate system, while
e.coordinates
are the user space coordinates of the event in the frame,
which depend on the values stored in
CTM
when the event arrives.
| | |
| Return: |
int
| | |
| See Also: |
eointersects,
infill,
instroke,
intersects
|
|
Yoix is a registered trademark of AT&T Inc.
|