mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
fixed drop error. added carrier velocity
This commit is contained in:
parent
7aa417dfc8
commit
197c4072c1
3 changed files with 23 additions and 9 deletions
|
|
@ -77,6 +77,15 @@ function (Nc) {
|
|||
Swiper.prototype.swipeEnd = function(x, y) {
|
||||
var angularVelocity = this.angleSum;
|
||||
var length = this.lengthSum;
|
||||
|
||||
if (this.points.length < 1) {
|
||||
return {
|
||||
x: 0,
|
||||
y: 0,
|
||||
av: 0
|
||||
}
|
||||
}
|
||||
|
||||
var p0x = this.points[0].x;
|
||||
var p0y = this.points[0].y;
|
||||
var sumx = 0;
|
||||
|
|
@ -103,11 +112,11 @@ function (Nc) {
|
|||
this.lengthSum = 0;
|
||||
this.points = [];
|
||||
|
||||
return {
|
||||
x: direction.x * length / 100,
|
||||
y: direction.y * length / 100,
|
||||
av: angularVelocity / 100
|
||||
}
|
||||
return {
|
||||
x: direction.x * length / 100,
|
||||
y: direction.y * length / 100,
|
||||
av: angularVelocity / 100
|
||||
}
|
||||
}
|
||||
|
||||
Swiper.prototype.destroy = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue