Consistently validate location on VectorShape by lesamouraipourpre · Pull Request #5327 · adafruit/circuitpython · GitHub
Skip to content

Consistently validate location on VectorShape#5327

Merged
microdev1 merged 4 commits into
adafruit:mainfrom
lesamouraipourpre:vectorio
Sep 11, 2021
Merged

Consistently validate location on VectorShape#5327
microdev1 merged 4 commits into
adafruit:mainfrom
lesamouraipourpre:vectorio

Conversation

@lesamouraipourpre

Copy link
Copy Markdown

Closes #5325

The x, y or location properties now use the same bounds validation whether set via the constructor or setters.
Tested with the code in #5325 which now raises Errors consistently when out of range.

@WarriorOfWire can you check if these changes are consistent with the rewrite and pass any test code you have?

VectorShape object so that it is consistent no matter where it is set from:
 * the constructor
 * the x and y setters
 * the location setter
@microdev1 microdev1 added this to the 7.0.0 milestone Sep 10, 2021

@kvc0 kvc0 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Validation consistency changes look good! I am concerned about breaking the correct semantic of the module set_location family functions.

Comment thread shared-bindings/vectorio/VectorShape.c Outdated
@lesamouraipourpre lesamouraipourpre marked this pull request as draft September 10, 2021 15:29
@microdev1 microdev1 removed this from the 7.0.0 milestone Sep 10, 2021
@lesamouraipourpre

Copy link
Copy Markdown
Author

Comment thread shared-module/vectorio/VectorShape.c Outdated
@lesamouraipourpre lesamouraipourpre marked this pull request as ready for review September 11, 2021 16:14

@microdev1 microdev1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! Thanks for the PR @lesamouraipourpre and @WarriorOfWire for the review.

@microdev1

microdev1 commented Sep 11, 2021

Copy link
Copy Markdown
Collaborator

@kvc0 kvc0 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is good, thanks!

@microdev1 microdev1 merged commit cf5c32b into adafruit:main Sep 11, 2021
@lesamouraipourpre lesamouraipourpre deleted the vectorio branch September 11, 2021 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vectorio doesn't consistently validate location

3 participants