dominikh / go-js-dom

MIT License
248 stars 42 forks source link

Missing: ImageData functions on Canavas2d ctx #43

Closed luckcolors closed 7 years ago

luckcolors commented 7 years ago

So i've been trying to work with gopherjs and noticed that js-dom does support canvas but not: https://developer.mozilla.org/it/docs/Web/API/CanvasRenderingContext2D/getImageData Image data specific functions such as GetImageData, PutImageData, CreateImageData (and then the relative functions for working with imageData.

Would it possible to add these to js-dom? I would be interested in making a pull request if so. :)

dmitshur commented 7 years ago

CanvasRenderingContext2D funcs are in scope, see https://github.com/dominikh/go-js-dom/pull/36 and https://github.com/dominikh/go-js-dom/pull/2 for precedent.

Feel free to send a PR, thanks!

luckcolors commented 7 years ago

I found this repo https://github.com/oskca/gopherjs-canvas So should i continue making my pull request? Ask if we could merge the repo? Or just drop this completely?

luckcolors commented 7 years ago

In my opinion it would be cool to have all of the apis in the same package.

luckcolors commented 7 years ago

On any case i finished writing the pull request. :D

dmitshur commented 7 years ago

That looks like a nice package, but unfortunately it's not very discoverable because it's not listed in https://github.com/gopherjs/gopherjs/wiki/Bindings. Also, some of the documentation is not English and therefore hard to read.

Since we've already started adding CanvasRenderingContext2D support and its API is not very large, completing it here sounds like the way to go. If we want, we can consider factoring it out/deferring to another library in the future.

luckcolors commented 7 years ago

Time to close this one as #44 is merged.