File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -129,12 +129,14 @@ function launchParticlesJS(tag_id, params){
129
129
/* detect retina */
130
130
if ( pJS . retina_detect && window . devicePixelRatio > 1 ) {
131
131
pJS . retina = true ;
132
- pJS . canvas . w = pJS . canvas . el . offsetWidth * 2 ;
133
- pJS . canvas . h = pJS . canvas . el . offsetHeight * 2 ;
134
- pJS . particles . anim . speed = pJS . particles . anim . speed * 2 ;
135
- pJS . particles . line_linked . distance = pJS . particles . line_linked . distance * 2 ;
136
- pJS . particles . line_linked . width = pJS . particles . line_linked . width * 2 ;
137
- pJS . interactivity . mouse . distance = pJS . interactivity . mouse . distance * 2 ;
132
+
133
+ var pixel_ratio = window . devicePixelRatio ;
134
+ pJS . canvas . w = pJS . canvas . el . offsetWidth * pixel_ratio ;
135
+ pJS . canvas . h = pJS . canvas . el . offsetHeight * pixel_ratio ;
136
+ pJS . particles . anim . speed = pJS . particles . anim . speed * pixel_ratio ;
137
+ pJS . particles . line_linked . distance = pJS . particles . line_linked . distance * pixel_ratio ;
138
+ pJS . particles . line_linked . width = pJS . particles . line_linked . width * pixel_ratio ;
139
+ pJS . interactivity . mouse . distance = pJS . interactivity . mouse . distance * pixel_ratio ;
138
140
}
139
141
140
142
You can’t perform that action at this time.
0 commit comments