Skip to content

fix: attach save() to p5.Graphics.prototype #8881#8886

Open
BHARATH0153 wants to merge 2 commits into
processing:mainfrom
BHARATH0153:fix/graphics-save
Open

fix: attach save() to p5.Graphics.prototype #8881#8886
BHARATH0153 wants to merge 2 commits into
processing:mainfrom
BHARATH0153:fix/graphics-save

Conversation

@BHARATH0153

@BHARATH0153 BHARATH0153 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Resolves #8881

Changes

Fixed save() not working on p5.Graphics

Previously save() was only attached to p5.prototype via the files module (registered through p5.registerAddon), so pg.save("test.png") threw TypeError: pg.save is not a function.

Now the files module is also called with p5.Graphics.prototype inside the graphics() registration function, following the exact same pattern as all other modules (primitives2D, attributes, image, pixels, etc.).

PR Checklist

  • npm run lint passes
  • Inline reference is included / updated
  • Unit tests are included / updated

@BHARATH0153 BHARATH0153 changed the title fix: attach save() to p5.Graphics.prototype #8877 fix: attach save() to p5.Graphics.prototype #8881 Jun 9, 2026
@BHARATH0153

BHARATH0153 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@perminder-17 @davepagurek please review and run the checks

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.

[p5.js 2.0+ Bug Report]:save() not working on graphics

1 participant