Clarify documentation of draw_polygon()'s coordinate format.

Previously, this function's documentation just stated that `coords`
contained the X and Y coordinates of the polygon's vertices, without
specifying in what order they were listed. Thus, it would have been
reasonable to (wrongly) assume that all the X coordinates were listed
in the first half of the array, followed by all the Y coordinates.

Now it's clear that each point's X and Y coordinates are stored
directly next to each other, and in that order.
This commit is contained in:
Franklin Wei
2024-08-11 20:57:51 -04:00
committed by Simon Tatham
parent 2a57df6be9
commit a993fd45eb

View File

@ -2162,7 +2162,11 @@ This function may be used for both drawing and printing.
Draws an outlined or filled polygon in the puzzle window. Draws an outlined or filled polygon in the puzzle window.
\c{coords} is an array of \cw{(2*npoints)} integers, containing the \c{coords} is an array of \cw{(2*npoints)} integers, containing the
\c{x} and \c{y} coordinates of \c{npoints} vertices. \c{x} and \c{y} coordinates of \c{npoints} vertices. The \c{x} and
\c{y} coordinates are stored in interleaved order, with each vertex's
\c{x} coordinate before its \c{y} coordinate. For example, the first
vertex's \c{x} and \c{y} coordinates are \c{coords[0]} and
\c{coords[1]}, respectively.
\c{fillcolour} and \c{outlinecolour} are integer indices into the \c{fillcolour} and \c{outlinecolour} are integer indices into the
colours array returned by the back end function \cw{colours()} colours array returned by the back end function \cw{colours()}