| rotatepath |
(Number angle) |
typedict.Path |
| |
Changes this path by applying a rotation of
angle
degrees (clockwise when
angle
is positive) to every point currently stored in this path,
and returns this path to the caller.
We can talk about clockwise or counterclockwise rotations 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);
appendpath(p2);
appendpath(p1);
rotatepath(15);
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
rotatepath.
| | |
| Return: |
Path
| | |
| See Also: |
appendpath,
Graphics,
scalepath,
shearpath,
transformpath,
translatepath
|
|
Yoix is a registered trademark of AT&T Inc.
|