resizing of canvas broken in combination with useWorker
See original GitHub issueFirst thanks a lot for this package, made celebrating hitting a milestone in our organisation a lot more fun! https://expedition-grundeinkommen.de/hamburg/
This is what I see in the console when using useWorker: true
:
Uncaught TypeError: canvas.getBoundingClientRect is not a function
Only in combination with supplying my own canvas element though.
I just glimpsed at the code and it seems like setCanvasRectSize
expects a canvas element but is called with an empty object as resizer
here: https://github.com/catdad/canvas-confetti/blob/master/src/confetti.js#L475
I am not that experienced in forking and local npm package development, that’s why I did not offer a pull reqest to fix it and just filed this issue for now. If that is appreciated I would give it a try.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to resize image in webworker using OffscreenCanvas ...
I pass imageUrl to web worker, that I then fetch, this gives me access to image data in it's blob format. I then...
Read more >Snowpack + Eleventy + Sass + PostCSS | Zell Liew
Sharing how I combined these tools together to create websites. ... Makes confetti confetti.create(canvas, { resize: true, useWorker: true } ...
Read more >engineering – Hexacta – Nearshore Development Software
Combined with other libraries and frameworks, such as Redux, Flux, or InmutableJs ... We drop the classification model into the canvas and leave...
Read more >Single Sign-On Implementation Guide
Configuring SAML single sign-on (SSO) for a canvas app lets users easily access a new or existing application as a part of their...
Read more >ECharts · Doc - GitHub Pages
Many of these components and charts can be combined in one chart. ... {self} resize, {void}, ECharts does not bind the resize event,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for reaching out! I’ll take a look tonight
I published an update (v1.1.2) which now allows initializing the control more than once. There are still issues though, which I may address later, but it mostly works. It is still not something that should be done realistically though. Thanks for pointing out this possible use case.