Skip to content
This repository was archived by the owner on Aug 24, 2020. It is now read-only.

Commit 3ecbba6

Browse files
Update rebound lib
1 parent 11217a7 commit 3ecbba6

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@angular/router": "^6.1.3",
2525
"core-js": "^2.5.7",
2626
"raf": "^3.1.0",
27-
"rebound": "0.0.13",
27+
"rebound": "^0.1.0",
2828
"sister": "^3.0.1",
2929
"underscore": "^1.9.1",
3030
"vendor-prefix": "^0.1.0",

src/app/modules/ionic-swing/swing/card.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import _ from 'underscore';
22

33
import Sister from 'sister';
4-
import rebound from 'rebound';
4+
import * as rebound from 'rebound';
55
import vendorPrefix from 'vendor-prefix';
66
import raf from 'raf';
77
import Direction from './direction';
@@ -381,8 +381,8 @@ const Card = (stack, targetElement) => {
381381
},
382382
onSpringUpdate: (spring) => {
383383
const value = spring.getCurrentValue();
384-
const coordianteX = rebound.MathUtil.mapValueInRange(value, 0, 1, lastThrow.fromX, 0);
385-
const coordianteY = rebound.MathUtil.mapValueInRange(value, 0, 1, lastThrow.fromY, 0);
384+
const coordianteX = rebound.util.mapValueInRange(value, 0, 1, lastThrow.fromX, 0);
385+
const coordianteY = rebound.util.mapValueInRange(value, 0, 1, lastThrow.fromY, 0);
386386

387387
onSpringUpdate(coordianteX, coordianteY);
388388
}
@@ -403,12 +403,12 @@ const Card = (stack, targetElement) => {
403403

404404
if (lastThrow.direction === Direction.RIGHT || lastThrow.direction === Direction.LEFT) {
405405
directionFactor = lastThrow.direction === Direction.RIGHT ? 1 : -1;
406-
coordianteX = rebound.MathUtil.mapValueInRange(value, 0, 1, lastThrow.fromX, throwOutDistance * directionFactor);
406+
coordianteX = rebound.util.mapValueInRange(value, 0, 1, lastThrow.fromX, throwOutDistance * directionFactor);
407407
coordianteY = lastThrow.fromY;
408408
} else if (lastThrow.direction === Direction.UP || lastThrow.direction === Direction.DOWN) {
409409
directionFactor = lastThrow.direction === Direction.DOWN ? 1 : -1;
410410
coordianteX = lastThrow.fromX;
411-
coordianteY = rebound.MathUtil.mapValueInRange(value, 0, 1, lastThrow.fromY, throwOutDistance * directionFactor);
411+
coordianteY = rebound.util.mapValueInRange(value, 0, 1, lastThrow.fromY, throwOutDistance * directionFactor);
412412
}
413413

414414
onSpringUpdate(coordianteX, coordianteY);

src/app/modules/ionic-swing/swing/stack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import _ from 'underscore';
22

33
import Sister from 'sister';
4-
import rebound from 'rebound';
4+
import * as rebound from 'rebound';
55

66
import Card from './card';
77

0 commit comments

Comments
 (0)