Skip to content

Don't draw lines and point with zero elements#2737

Merged
einarf merged 1 commit intodevelopmentfrom
point-line-0-fix
Jun 23, 2025
Merged

Don't draw lines and point with zero elements#2737
einarf merged 1 commit intodevelopmentfrom
point-line-0-fix

Conversation

@einarf
Copy link
Member

@einarf einarf commented Jun 23, 2025

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_points and draw_lines to skip rendering on empty input
  • Update CHANGELOG.md to 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_points to 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_lines to ensure the guard prevents any rendering attempts.
    if num_points == 0:

@einarf einarf merged commit c68bac6 into development Jun 23, 2025
7 checks passed
@einarf einarf deleted the point-line-0-fix branch June 23, 2025 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants