Skip to content

Commit

Permalink
set 45 px / 10px offset for swipes
Browse files Browse the repository at this point in the history
  • Loading branch information
sverosak committed Mar 20, 2014
1 parent 6aefcaa commit 10f9062
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/index.js
Expand Up @@ -143,6 +143,8 @@ function round(num){
return Math.round(num);
}

var HORIZONTAL_OFFSET = 45;
var VERTICAL_OFFSET = 10;
function swipe(direction, elem, ms, frames, getEvent) {
var elemSize = getChildrenSize(elem.parentNode);

Expand All @@ -155,14 +157,14 @@ function swipe(direction, elem, ms, frames, getEvent) {
y = elemSize.height;
x = elemSize.width / 2;

from = [x*0.95, y*0.1].map(round);
to = [x*1.01, y*0.9].map(round);
from = [x*0.95, VERTICAL_OFFSET].map(round);
to = [x*1.01, y-VERTICAL_OFFSET].map(round);
} else {
// horizontal
x = elemSize.width;
y = elemSize.height / 2;
from = [x * 0.05, y].map(round);
to = [x * 0.95, y].map(round);
from = [HORIZONTAL_OFFSET, y*0.98].map(round);
to = [x - HORIZONTAL_OFFSET, y*1.01].map(round);
}

if (direction === 'right' || direction === 'top') {
Expand Down

0 comments on commit 10f9062

Please sign in to comment.