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
currentpoint () typedict.Path
 
Returns a Point that represents this path's current point, which for all practical purposes can be thought of as the last point added to this path, or NULL if this path is empty. Transformations that modify the CTM have no affect on the current point itself, but they do affect the coordinates of the point returned by currentpoint. Applications often check the value returned by currentpoint when the need to know if a path is empty or not.
 
 Example:   The program,
import yoix.stdio.*;

Path p;
Point pt;

p.moveto(50, 50);
p.lineto(50, 100);
printf("Output before CTM change:\n");
pt = p.currentpoint();
printf(" currentpoint=(%.1f, %.1f)\n", pt.x, pt.y);
p.CTM.scale(.5, .5);
printf("\nOutput after CTM change:\n");
pt = p.currentpoint();
printf(" currentpoint=(%.1f, %.1f)\n", pt.x, pt.y);
prints something like
Output before CTM change:
 currentpoint=(50.0, 100.0)

Output after CTM change:
 currentpoint=(100.0, 200.0)
on standard output. Notice how the coordinates changed after we scaled the CTM associated with the path.
 
 Return:   Point
 
 See Also:   arc, arcn, closepath, currentpath, curveto, flattenpath, Graphics, lineto, moveto, newpath, pathbbox, pathforall, quadto, rcurveto, rlineto, rmoveto, rquadto

 

Yoix is a registered trademark of AT&T Inc.