Skip to content

Fix graphics size error#8545

Merged
perminder-17 merged 2 commits into
processing:mainfrom
yugalkaushik:fix-graphics-size-error
May 14, 2026
Merged

Fix graphics size error#8545
perminder-17 merged 2 commits into
processing:mainfrom
yugalkaushik:fix-graphics-size-error

Conversation

@yugalkaushik
Copy link
Copy Markdown
Contributor

Resolved #4956

Changes:

  • Added instanceof check in p5.Element.prototype.size() to detect p5.Graphics
  • Shows error directing users to resizeCanvas()
  • Added unit test to verify the error message is shown

PR Checklist

@yugalkaushik
Copy link
Copy Markdown
Contributor Author

@davepagurek Can I get a review on this?

@perminder-17 perminder-17 self-requested a review May 14, 2026 07:09
Copy link
Copy Markdown
Collaborator

@perminder-17 perminder-17 left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks for your work @yugalkaushik .

@perminder-17 perminder-17 merged commit 4bb8deb into processing:main May 14, 2026
4 checks passed
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.

size() throws error with p5.Graphics

2 participants