question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

resizing of canvas broken in combination with useWorker

See original GitHub issue

First 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:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
catdadcommented, Mar 4, 2020

Thanks for reaching out! I’ll take a look tonight

0reactions
catdadcommented, Mar 8, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found