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

Q: where to go for DOMMatrix.invertSelf support #85

Open
monfera opened this issue Aug 18, 2021 · 5 comments
Open

Q: where to go for DOMMatrix.invertSelf support #85

monfera opened this issue Aug 18, 2021 · 5 comments

Comments

@monfera
Copy link

monfera commented Aug 18, 2021

DOMMatrix.invertSelf and the other DOMMatrix functions are super useful for working with objects that Canvas2d context functions use natively. Where do people get it from? I'm running things in current Jest, and get an Error: Uncaught [Error: Not implemented]

Specifically I use it via

const { a, d } = ctx.getTransform().invertSelf().scale(ctx.canvas.width, ctx.canvas.height)
@monfera
Copy link
Author

monfera commented Aug 18, 2021

My guess is that both jest-canvas-mock and jsdom have a DOMMatrix representation, but

  • jest-canvas-mock doesn't implement DOMMatrix.invertSelf because it's NOT a method on the canvas context
  • the jest-canvas-mock version of DOMMatrix is of course different from the jsdom one, and jsdom of course has no idea that it should "take over"

Oblig. banana gorilla problem

@jtenner
Copy link
Collaborator

jtenner commented Sep 1, 2021

First and foremost, we are "mocking" an environment, so things like this are going to happen.

Let's fix this today.

@iMoses
Copy link

iMoses commented Apr 15, 2024

@jtenner today was a long time ago :)
need help with it? would a PR be appreciated?

@jtenner
Copy link
Collaborator

jtenner commented Apr 15, 2024

Hey I appreciate the sarcasm. My work here was a best ditch effort from me as a newbie developer, and I'm sorry for not having enough time to re-contribute back to this project.

@jtenner
Copy link
Collaborator

jtenner commented Apr 15, 2024

As for help with the project, I'm sure this project could always use a pull request.

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

No branches or pull requests

3 participants