Closed afparsons closed 6 years ago
Was a solution ever found for this? Also experiencing.
@afparsons @EthanC you need to add style in the Particles
style={{
position: "fixed",
top: 0,
left: 0,
width: "100%",
height: "100%"
}}
@bichenkk Is it necessary to have that position fixed? I really cannot manage to solve this issue. I am trying to have particles wrapped in a div with a specific size, relative position, not fixed.
Under this situation, if I, for example, set the container div with 500px height and width...the resulted canvas has 250px height.
How to solve it?
Thanks!
Answers given, closing.
Expected Behavior Canvas would responsively resize to fit window.
Actual Behavior Height shrinks to half of canvas width during resize. W:H scaling ratio appears to be set to 2:1.
Specifications Version: 2.1.0 Browsers: Firefox 57, Chrome 62 package.json:
"dependencies": {
"canvas-particle-network": "^1.5.0",
"material-ui": "^1.0.0-beta.21",
"material-ui-icons": "^1.0.0-beta.17",
"material-ui-search-bar": "^1.0.0-beta.3",
"react": "^16.1.1",
"react-dom": "^16.1.1",
"react-particles-js": "^2.1.0",
"react-scripts": "1.0.17",
"react-tap-event-plugin": "^3.0.2"
}
Possible Solution: Stackoverflow
The solution is likely relatively simple. I however don't understand how preventing the 2:1 scale ratio is implemented in the React component. Upon resolving I can add a note to the Readme.md
Edit: formatting