Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify that line() and polygon() include xy pixels #7142

Merged
merged 1 commit into from
May 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/reference/ImageDraw.rst
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ Methods
.. py:method:: ImageDraw.line(xy, fill=None, width=0, joint=None)

Draws a line between the coordinates in the ``xy`` list.
The coordinate pixels are included in the drawn line.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a bit clearer?

Suggested change
The coordinate pixels are included in the drawn line.
The endpoint coordinate pixels are included in the drawn line.

Or simply?

Suggested change
The coordinate pixels are included in the drawn line.
The endpoint pixels are included in the drawn line.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to update it with any wording that you think is clearer, but both line() and polygon() accept a series of coordinates. I wonder if saying 'endpoint' implies it is only the first and last of those coordinates that are included?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, good point. Not sure now! Let's stick with the original :)


:param xy: Sequence of either 2-tuples like ``[(x, y), (x, y), ...]`` or
numeric values like ``[x, y, x, y, ...]``.
Expand Down Expand Up @@ -287,7 +288,7 @@ Methods

The polygon outline consists of straight lines between the given
coordinates, plus a straight line between the last and the first
coordinate.
coordinate. The coordinate pixels are included in the drawn polygon.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
coordinate. The coordinate pixels are included in the drawn polygon.
coordinate. The endpoint coordinate pixels are included in the drawn polygon.
Suggested change
coordinate. The coordinate pixels are included in the drawn polygon.
coordinate. The endpoint pixels are included in the drawn polygon.


:param xy: Sequence of either 2-tuples like ``[(x, y), (x, y), ...]`` or
numeric values like ``[x, y, x, y, ...]``.
Expand Down