Skip to content

Conversation

@aryashi100
Copy link

Addresses a renderer contract mismatch noted in code comments.

Changes:

  • Updated p5.Renderer.pop() to return the restored renderer style after state restoration.
  • Aligns implementation with comments in p5.Renderer2D.js that describe the expected renderer contract.
  • Note: While running the test suite locally, one existing documentation test for loadFont (example Rhino test #4) failed. This appears unrelated to the renderer change and was present prior to this modification.

Screenshots of the change:
N/A (code-only change)

PR Checklist

Copy link
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.

Hi, thanks for the PR. Actually the work of pop() is to not to return anything but to restore the previous state. So, the code doesn't needs any return, bcz caller is not gonna use that returned value, instead can cause confusions.

@aryashi100
Copy link
Author

Thanks for the clarification @perminder-17 !
The pop() implementation has been updated to only restore the previous state and no longer returns any value.

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