Don't draw lines and point with zero elements#2737
Merged
einarf merged 1 commit intodevelopmentfrom Jun 23, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR prevents drawing undefined primitives when an empty list is passed to the drawing functions and records the fix in the changelog.
- Add early-exit guards in
draw_pointsanddraw_linesto skip rendering on empty input - Update
CHANGELOG.mdto document the fix
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| arcade/draw/point.py | Added if num_points == 0: return to skip empty input |
| arcade/draw/line.py | Added if num_points == 0: return to skip empty input |
| CHANGELOG.md | Documented fix for empty-list drawing issue |
Comments suppressed due to low confidence (2)
arcade/draw/point.py:67
- Add unit tests for passing an empty list to
draw_pointsto verify that no draw calls or errors occur.
if num_points == 0:
arcade/draw/line.py:115
- Add unit tests for passing an empty list to
draw_linesto ensure the guard prevents any rendering attempts.
if num_points == 0:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.