rescript-webapi
rescript-webapi copied to clipboard
Path2D as Module?
Example of path2D as currently
let path: path2d = newPath2D("M24.85,10.126c2.018-4.783,6.628-8.125,11.99-8.125c7.223")
ctx->beginPath
ctx->strokePath2D(path)
ctx->fillPath2D(path)
After working with react rescript bindings would expect Path2D to be it's own module like
let path: path2d = Path2D.make("M24.85,10.126c2.018-4.783,6.628-8.125,11.99-8.125c7.223")
ctx->beginPath
ctx-> Path2D.stroke(path)
ctx-> Path2D.fill(path)
That would be a breaking change, however Path2D bindings seems currently on an early stage
Would a PR with those changes be accepted?
If so, would be possible to add all remaining Path2D method bindings to that module
Path2D.addPath() Path2D.closePath() Path2D.moveTo() Path2D.lineTo() Path2D.bezierCurveTo() Path2D.quadraticCurveTo() Path2D.arc() Path2D.arcTo() Path2D.ellipse() Path2D.rect() Path2D.roundRect()
Because it was contributed that way in #45 🤷♂️
Yes, I'd accept a PR to add a new module. I am a couple of years overdue for publishing a 1.0 release, that seems like a good breaking change to have
you didn't need to close this - your PR would automatically close it when merged.
may add more canvas tests