Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Canvas2d.putImageData creates erroneous calls when not using all the optionals. #180

Closed
fhammerschmidt opened this issue May 8, 2020 · 3 comments

Comments

@fhammerschmidt
Copy link

Here is a repro:
https://codesandbox.io/s/gifted-platform-rffze?file=/src/index.js

@glennsl
Copy link
Member

glennsl commented May 8, 2020

Hmm, that's unfortunate. I think the only fix here is to split the binding in two. One with just the x and y arguments, and another with all the dirty arguments as well, all mandatory.

@fhammerschmidt
Copy link
Author

Yeah, that's my guess, too.
When you call it with less arguments it even says it only allows arity of 3 or 7, so there is not really any optional argument there.

@yawaramin
Copy link
Collaborator

@fhammerschmidt if you would like to give this a shot, I would recommend the following:

  • Change the type of putImageData to not take the extra params
  • Add a new binding for putImageDataWithDirtyRect that requires all of the parameters

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

No branches or pull requests

3 participants