fix proportions bug
This commit is contained in:
@@ -5,7 +5,7 @@ const socket = io("http://localhost:3000");
|
||||
|
||||
const params = {
|
||||
fps: 60,
|
||||
zoom: 0.1,
|
||||
zoom: 1, //in pixels per pixel
|
||||
backgroundTicks: 60,
|
||||
textSpread: 0,
|
||||
maxSpawns: 1,
|
||||
@@ -135,8 +135,8 @@ const sketch = (p) => {
|
||||
// current width/height
|
||||
|
||||
if (bgTick++ == 0) {
|
||||
cw = Math.floor(imageW * params.zoom);
|
||||
ch = Math.floor(imageH * params.zoom);
|
||||
cw = Math.floor(p.width * params.zoom);
|
||||
ch = Math.floor(p.height * params.zoom);
|
||||
// random starting position
|
||||
// subtract cw/ch to avoid going out of bounds
|
||||
sx = Math.random(0) * (imageW - cw);
|
||||
|
||||
Reference in New Issue
Block a user