From 544ed95e6d3ea01d35966ec88755a5a2b7bb5110 Mon Sep 17 00:00:00 2001 From: Adam Piskorek Date: Tue, 3 Oct 2023 06:47:59 +0200 Subject: [PATCH] fix args unpacking for corners mode (#442) * fix args unpacking for corners mode * docs upgrade for rect corners mode * docs: deprecated setting --- docs/guides/vscode.rst | 6 +++--- p5/core/primitives.py | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/guides/vscode.rst b/docs/guides/vscode.rst index 20535452..6e4ee8e0 100644 --- a/docs/guides/vscode.rst +++ b/docs/guides/vscode.rst @@ -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", diff --git a/p5/core/primitives.py b/p5/core/primitives.py index d4ee8471..59a0b249 100644 --- a/p5/core/primitives.py +++ b/p5/core/primitives.py @@ -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 @@ -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: