-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Move PNG_* constants to constructor, clean up toBuffer API #934
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
Labels
Comments
I do not believe that they need to be on the prototype. The third argument was added in a strange backwards-compatible way, and you pass undefined first only in this case, so you can consider cleaning it up now.
…On July 1, 2017 12:59:33 AM GMT+03:00, Zach Bjornson ***@***.***> wrote:
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:
```js
var buf2 = canvas.toBuffer(undefined, 3, canvas.PNG_FILTER_NONE);
```
would become
```js
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?
|
Merged
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.
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. |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:would become
The constants were added in 14d9f58. @kkoopa you added these -- do they need to be on the prototype?
The text was updated successfully, but these errors were encountered: