AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YChart | YDAT | YWAIT | Byzgraf | FAQs
ineofill (Point p) typedict.Graphics
ineofill (Number x, Number y)  
 
Returns non-zero if p or the point (x, y) lies inside the current 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.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:   clip, clippath, drawablebbox, eoclip, eoerase, eofill, erase, erasedrawable, fill, infill, instroke, rectbutton, rectclip, rectcopy, recterase, rectfill, rectmove, rectstroke, stroke, strokepath

 

Yoix is a registered trademark of AT&T Inc.