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
shearpath (Number shx, Number shy) typedict.Path
 
Changes this path by applying a horizontal shearing of shx and a vertical shearing of shy to every point currently stored in this path. We can talk about horizontal and vertical shearing because the coordinates of the points in a path are always assumed to be stored in device space, which closely matches the device-dependent coordinate system that Java assigns to your screen.
 
 Example:   The program,
import yoix.*.*;

Path p1;
Path p2;

p1 {        // "named block"
    moveto(0, 0);
    rlineto(72, 0);
    rlineto(0, 36);
    closepath();
    rmoveto(72, 36);
}

p2 {        // "named block"
    moveto(0, 0);
    rlineto(72, -36);
}

JFrame f = {
    Color background = Color.white;

    paint(Rectangle r) {
        graphics {        // "named block"
            moveto(72, 72);
            appendpath(p1);
            shearpath(1.25, 0);
            appendpath(p2);
            appendpath(p1);
            gsave();
            setrgbcolor(0, 0, 1);
            fill();
            grestore();
            setrgbcolor(1, 0, 0);
            stroke();
        }
    }
};

f.visible = TRUE;
defines a paint function in a frame that fills and strokes a path that is built from two separate paths using appendpath and shearpath.
 
 Return:   Path
 
 See Also:   appendpath, Graphics, rotatepath, scalepath, transformpath, translatepath

 

Yoix is a registered trademark of AT&T Inc.