react-native-make-it-rain icon indicating copy to clipboard operation
react-native-make-it-rain copied to clipboard

Straight down?

Open ajohnson1031 opened this issue 4 years ago • 2 comments

Any way to make icons fall straight down instead of moving side to side?

ajohnson1031 avatar May 28 '21 12:05 ajohnson1031

Try setting the prop horizSpeed={0}

peacechen avatar May 28 '21 13:05 peacechen

Doesn't seem to be working. Looking at the source code, it looks like these functions are what govern the side-to-side behavior:

`const spring = (dt, position, velocity, anchor, tension = 50, mass = 1) => { const dist = sub(position, anchor); const acc = divide(multiply(-1, tension, dist), mass); return set(velocity, add(velocity, multiply(dt, acc))); };

const swingArc = (x, y, xArc, yBase, anchor) => { const percentArc = divide(abs(sub(x, anchor)), xArc); const yOffset = multiply(percentArc, divide(xArc, 4)); return set(y, sub(yBase, yOffset)); };`

Would you be mind if I PR'd a third option that doesn't have the swinging?

ajohnson1031 avatar May 28 '21 14:05 ajohnson1031