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

Fixed PSDraw rectangle #6429

Merged
merged 3 commits into from Jul 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 6 additions & 12 deletions src/PIL/PSDraw.py
Expand Up @@ -86,16 +86,10 @@ def rectangle(self, box):
"""
Draws a rectangle.

:param box: A 4-tuple of integers whose order and function is currently
undocumented.

Hint: the tuple is passed into this format string:

.. code-block:: python

%d %d M %d %d 0 Vr\n
:param box: A tuple of four integers, specifying left, bottom, width and
height.
"""
self.fp.write(b"%d %d M %d %d 0 Vr\n" % box)
self.fp.write(b"%d %d M 0 %d %d Vr\n" % box)

def text(self, xy, text):
"""
Expand Down Expand Up @@ -188,10 +182,10 @@ def image(self, box, im, dpi=None):
/Vl { moveto lineto stroke } bind def
/Vc { newpath 0 360 arc closepath } bind def
/Vr { exch dup 0 rlineto
exch dup neg 0 exch rlineto
exch dup 0 exch rlineto
exch neg 0 rlineto
0 exch rlineto
100 div setgray fill 0 setgray } bind def
0 exch neg rlineto
setgray fill } bind def
/Tm matrix def
/Ve { Tm currentmatrix pop
translate scale newpath 0 0 .5 0 360 arc closepath
Expand Down