Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move PNG_* constants to constructor, clean up toBuffer API #934

Closed
zbjornson opened this issue Jun 30, 2017 · 2 comments
Closed

Move PNG_* constants to constructor, clean up toBuffer API #934

zbjornson opened this issue Jun 30, 2017 · 2 comments
Assignees

Comments

@zbjornson
Copy link
Collaborator

Proposal for a breaking change in 2.0: move all the PNG_* constants from the Canvas prototype to be static members of the Canvas constructor. That is, this doc example:

var buf2 = canvas.toBuffer(undefined, 3, canvas.PNG_FILTER_NONE);

would become

var buf2 = canvas.toBuffer(undefined, 3, Canvas.PNG_FILTER_NONE);

The constants were added in 14d9f58. @kkoopa you added these -- do they need to be on the prototype?

@kkoopa
Copy link
Contributor

kkoopa commented Jul 1, 2017 via email

@zbjornson zbjornson changed the title Move PNG_* constants to constructor? Move PNG_* constants to constructor, clean up toBuffer API Aug 30, 2017
@zbjornson zbjornson changed the title Move PNG_* constants to constructor, clean up toBuffer API (2.0) Move PNG_* constants to constructor, clean up toBuffer API Sep 19, 2017
@zbjornson zbjornson self-assigned this Jun 7, 2018
zbjornson added a commit to zbjornson/node-canvas that referenced this issue Jul 2, 2018
Ref Automattic#934

Not sure we should do this. If browsers ever get this, they won't have a Canvas constructor, so this definitely wouldn't be the API.
@zbjornson zbjornson changed the title (2.0) Move PNG_* constants to constructor, clean up toBuffer API Move PNG_* constants to constructor, clean up toBuffer API Oct 14, 2018
@zbjornson
Copy link
Collaborator Author

I think this would be the wrong direction after all. If the Canvas spec ever gets an equivalent property, it won't be on the Canvas constructor, because there is no Canvas constructor. :)

Fine as-is methinks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants