Skip to content

Commit

Permalink
fix args unpacking for corners mode (#442)
Browse files Browse the repository at this point in the history
* fix args unpacking for corners mode

* docs upgrade for rect corners mode

* docs: deprecated setting
  • Loading branch information
hvitis authored Oct 3, 2023
1 parent f786218 commit 544ed95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/guides/vscode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ Setup
3. In the ``.vscode`` directory create a file called ``settings.json``
4. In that file copy and paste all of these json settings:

.. code::
.. code::
{
"python.linting.pylintArgs": [
"--disable", "E0102",
"pylint.args": [
"--disable", "E0102",
"--disable", "C0111",
"--disable", "W0401",
"--disable", "C0304",
Expand Down
5 changes: 2 additions & 3 deletions p5/core/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def rect(*args, mode: Optional[str] = None):
:param args: For modes'CORNER' or 'CENTER' this has the form
(width, height); for the 'RADIUS' this has the form
(half_width, half_height); and for the 'CORNERS' mode, args
should be the corner opposite to `coordinate`.
should be two int values x, y - the coords of corner opposite to `coordinate`.
:type: tuple
Expand Down Expand Up @@ -602,8 +602,7 @@ def rect(*args, mode: Optional[str] = None):
height = 2 * half_height
elif mode == "CORNERS":
corner = Point(*coordinate)
(corner_2,) = args
corner_2 = Point(*corner_2)
corner_2 = Point(*args)
width = corner_2.x - corner.x
height = corner_2.y - corner.y
else:
Expand Down

0 comments on commit 544ed95

Please sign in to comment.