diff options
Diffstat (limited to 'html/en/func')
-rw-r--r-- | html/en/func/filled.html | 24 | ||||
-rw-r--r-- | html/en/func/lines.html | 22 | ||||
-rw-r--r-- | html/en/func/polygon.html | 31 |
3 files changed, 47 insertions, 30 deletions
diff --git a/html/en/func/filled.html b/html/en/func/filled.html index 2ae1083..97a2e84 100644 --- a/html/en/func/filled.html +++ b/html/en/func/filled.html @@ -63,25 +63,29 @@ canvas:fSector(xc, yc, w, h, angle1, angle2: number) [in Lua] canvas:wSector(xc, yc, w, h, angle1, angle2: number) (WC) [in Lua]</pre> <p>Fills the arc of an ellipse aligned with the axis, according to the current - interior style, in the shape of a pie. It is drawn counter-clockwise. The + interior style, in the shape of a pie. </p> +<p>The coordinate <b>(xc,yc)</b> defines the center of the ellipse. Dimensions <b>w</b> and <b>h</b> define the elliptic axes X and Y, respectively. </p> - <p>Angles <b>angle1</b> and <b>angle2</b>, in degrees, - define the arc's beginning and end, but they are not the angle relative to the + <p>Angles <b>angle1</b> and <b>angle2</b> are in degrees and oriented + counter-clockwise. They + define the arc start and end, but they are not the angle relative to the center, except when w==h and the ellipse is reduced to a circle. The arc - starts at the point <b>(xc+(w/2)*cos(angle1),yc+(h/2)*sin(angle1))</b> - and ends at <b>(xc+(w/2)*cos(angle2),yc+(h/2)*sin(angle2))</b>. A - complete ellipse can be drawn using 0 and 360 as the angles. </p> + starts at the point <b>(xc+(w/2)*cos(angle1), yc+(h/2)*sin(angle1))</b> + and ends at <b>(xc+(w/2)*cos(angle2), yc+(h/2)*sin(angle2))</b>. A + complete ellipse can be drawn using 0 and 360 as the angles. If <b>angle2</b> + is less than <b>angle1</b> it will be increased by 360 until it is greater + than <b>angle1</b>. </p> <p>The angles are specified so if the size of the ellipse (w x h) is changed, its shape is preserved. So the angles relative to the center are dependent - from the ellipse size. The actual angle can be obtained using <tt><b>rangle = - atan2((h/2</b></tt><b>)*sin(angle),(w/2)*cos(angle))</b>.</p> - <p>The angles are given in degrees. To specify the angle in radians, you can + from the ellipse size. The actual angle can be obtained using <b>rangle = + atan2((h/2)*sin(angle), (w/2)*cos(angle))</b>.</p> + <p>To specify the angle in radians, you can use the definition <font size="2"><strong>CD_RAD2DEG</strong></font> to multiply the value in radians before passing the angle to CD. </p> <p>When the interior style <font><strong>CD_HOLLOW</strong></font> is defined, - the function behaves like its equivalent <strong><font>cdArc</font></strong>, + the function behaves like its equivalent <strong><font>cdCanvasArc</font></strong>, plus two lines connecting to the center.</p> <p align="center"><font size="4">Sector Parameters</font><br> <img src="../../img/sector.gif" border="2" width="161" height="160"></p> diff --git a/html/en/func/lines.html b/html/en/func/lines.html index b748391..6ba78d7 100644 --- a/html/en/func/lines.html +++ b/html/en/func/lines.html @@ -1,5 +1,5 @@ <!doctype HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> +<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> <head> <meta http-equiv="Content-Language" content="en-us"> @@ -64,21 +64,25 @@ canvas:fArc(xc, yc, w, h, angle1, angle2: <em>number</em>) [in Lua] canvas:wArc(xc, yc, w, h, angle1, angle2: <em>number</em>)<font><font> (WC) [in Lua]</font></font></pre> <p>Draws the arc of an ellipse aligned with the axis, using the current - foreground color and line width and style. It is drawn counter-clockwise. The + foreground color and line width and style.</p> +<p>The coordinate <b>(xc,yc)</b> defines the center of the ellipse. Dimensions <b>w</b> and <b>h</b> define the elliptic axes X and Y, respectively. </p> - <p>Angles <b>angle1</b> and <b>angle2</b>, in degrees define - the arc's beginning and end, but they are not the angle relative to the + <p>Angles <b>angle1</b> and <b>angle2</b> are in degrees and oriented + counter-clockwise. They define + the arc start and end, but they are not the angle relative to the center, except when w==h and the ellipse is reduced to a circle. The arc - starts at the point <b><b>(xc+(w/2)*cos(angle1),yc+(h/2)*sin(angle1))</b> - </b>and ends at <b>(xc+(w/2)*cos(angle2),yc+(h/2)*sin(angle2))</b>. A - complete ellipse can be drawn using 0 and 360 as the angles. </p> + starts at the point <b><b>(xc+(w/2)*cos(angle1), yc+(h/2)*sin(angle1))</b> + </b>and ends at <b>(xc+(w/2)*cos(angle2), yc+(h/2)*sin(angle2))</b>. A + complete ellipse can be drawn using 0 and 360 as the angles. If <b>angle2</b> + is less than <b>angle1</b> it will be increased by 360 until it is greater + than <b>angle1</b>. </p> <p>The angles are specified so if the size of the ellipse (w x h) is changed, its shape is preserved. So the angles relative to the center are dependent from the ellipse size. The actual angle can be obtained using <b>rangle = - atan2((h/2</b><b>)*sin(angle),(w/2)*cos(angle))</b>.</p> - <p>The angles are given in degrees. To specify the angle in radians, you can + atan2((h/2</b><b>)*sin(angle), (w/2)*cos(angle))</b>.</p> + <p>To specify the angle in radians, you can use the definition <font size="2"><strong>CD_RAD2DEG</strong></font> to multiply the value in radians before passing the angle to CD.</p> <p align="center"><font size="4">Arc Parameters<br> diff --git a/html/en/func/polygon.html b/html/en/func/polygon.html index 3a0b9c0..c2acb9a 100644 --- a/html/en/func/polygon.html +++ b/html/en/func/polygon.html @@ -93,42 +93,43 @@ canvas:PathSet(action: number) [in Lua]</pre> <p>Configures the action between sequences of <strong>cdCanvasVertex</strong>. <strong>action</strong> can be:</p> <ul> - <li> CD_PATH_NEW - creates a new empty path. Useful if more than one + <li> <strong>CD_PATH_NEW</strong> - creates a new empty path. Useful if more than one path is configured. <strong>cdCanvasBegin</strong>(CD_PATH) already creates a new path.</li> - <li>CD_PATH_MOVETO - moves the current position to the given coordinates. + <li><strong>CD_PATH_MOVETO</strong> - moves the current position to the given coordinates. Must be followed by 1 call to <strong>cdCanvasVertex</strong>, <strong> cdfCanvasVertex</strong>, or <strong>wdCanvasVertex</strong>.</li> - <li>CD_PATH_LINETO - adds a line to the path from the current position to + <li><strong>CD_PATH_LINETO</strong> - adds a line to the path from the current position to the given coordinates. The current position is updated to the given coordinates. If there is no current position, nothing is connected and only the current position is updated. Must be followed by 1 call to <strong> cdCanvasVertex</strong>, <strong>cdfCanvasVertex</strong>, or <strong> wdCanvasVertex</strong>.</li> - <li>CD_PATH_ARC - adds an arc to the path. If there is a current position + <li><strong>CD_PATH_ARC</strong> - adds an arc to the path. If there is a current position adds also a line from the current position to the start of the arc. The end of the arc becomes the current position. Must be followed by 3 calls to <strong>cdCanvasVertex</strong>, <strong>cdfCanvasVertex</strong>, or <strong>wdCanvasVertex</strong>. One for the center of the arc (xc,yc), one for the bounding rectangle size (w,h), and one for the start and end angles - (angle1,angle2). Angles are in degrees. When using integer coordinates + (angle1,angle2). Angles are in degrees and oriented counter-clockwise, but + angle2 can be smaller than angle1 to describe a clockwise arc. When using integer coordinates angles must be multiplied by 1000.</li> - <li>CD_PATH_CURVETO - adds a bezier curve to the path. If there is no + <li><strong>CD_PATH_CURVETO</strong> - adds a bezier curve to the path. If there is no current position, the first point will be used twice. The end point becomes the current position. Must be followed by 3 calls to <strong>cdCanvasVertex</strong>, <strong>cdfCanvasVertex</strong>, or <strong>wdCanvasVertex</strong>. Must be first control point (x1,y1) + second control point (x2,y2) + end point (x3,y3).</li> - <li>CD_PATH_CLOSE - adds a line to the path that connects the last point + <li><strong>CD_PATH_CLOSE</strong> - adds a line to the path that connects the last point with the first point of the path, closing it.</li> - <li>CD_PATH_FILL - fills the path with the current fill attributes, + <li><strong>CD_PATH_FILL</strong> - fills the path with the current fill attributes, then the path is discarded.</li> - <li>CD_PATH_STROKE - strokes the path with the current line attributes, then the + <li><strong>CD_PATH_STROKE</strong> - strokes the path with the current line attributes, then the path is discarded.</li> - <li>CD_PATH_FILLSTROKE - fills the path with the current fill + <li><strong>CD_PATH_FILLSTROKE</strong> - fills the path with the current fill attributes, strokes the path with the current line attributes, then the path is discarded.</li> - <li>CD_PATH_CLIP - use the path as a clipping area to be + <li><strong>CD_PATH_CLIP</strong> - use the path as a clipping area to be intersected with the current clipping area, then the path is discarded.</li> </ul> @@ -139,6 +140,14 @@ cdCanvasPathSet(canvas, CD_PATH_MOVETO); cdCanvasVertex(canvas, x1, y1); cdCanvasPathSet(canvas, CD_PATH_LINETO); cdCanvasVertex(canvas, x2, y2); +cdCanvasPathSet(canvas, CD_PATH_CURVETO); +cdCanvasVertex(canvas, x3, y3); /* control point for start point */ +cdCanvasVertex(canvas, x4, y4); /* control point for end point */ +cdCanvasVertex(canvas, x5, y5); /* end point */ +cdCanvasPathSet(canvas, CD_PATH_ARC); +cdCanvasVertex(canvas, x6, y6); /* center */ +cdCanvasVertex(canvas, x7, y7); /* width, height */ +cdCanvasVertex(canvas, x8, y8); /* start angle, end angle (degrees / 1000) */ cdCanvasPathSet(canvas, CD_PATH_STROKE); cdCanvasEnd(canvas);</pre> |