wufe / react-particles-js

Particles.js for React
https://rpj.bembi.dev/
MIT License
1.15k stars 106 forks source link

Canvas stretches particles until resize #175

Closed Jhappy77 closed 2 years ago

Jhappy77 commented 3 years ago

The canvas starts at a default height. Any CSS selectors that set the height to 100% only stretch the particles, not change the height attribute of the canvas. Once I resize my window, everything works as intended, but it is horribly stretched until the window is resized for the first time and the canvas size recalculates.

Is there any way to force the canvas size to recalculate immediately? I don't want this stretch effect image Initial stretched version (upon reloading site). The canvas has a height attribute of 575, the particles appear as if the canvas was 575px but are stretched to fit the full content.

After resizing the window, the canvas height goes to 100% of parent div like it should, and everything works as intended image

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.