Skip to content

Commit

Permalink
Combine bottom parameter with height to simplify use
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jul 11, 2022
1 parent ed98c66 commit cecd3f3
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/PIL/PSDraw.py
Expand Up @@ -86,16 +86,11 @@ 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 0 %d %d Vr\n
:param box: A tuple of four integers, specifying left, bottom, width and
height.
"""
self.fp.write(b"%d %d M 0 %d %d Vr\n" % box)
left, bottom, width, height = box
self.fp.write(b"%d %d M 0 %d %d Vr\n" % (left, bottom + height, width, height))

def text(self, xy, text):
"""
Expand Down

0 comments on commit cecd3f3

Please sign in to comment.