mirror of https://github.com/espruino/BangleApps
kineticscroll - Fix warnings and whitespace
parent
ecbac6e017
commit
98325fa102
|
@ -51,7 +51,7 @@
|
|||
for (var i=a;i<=b;i++)
|
||||
options.draw(i, {x:R.x,y:idxToY(i),w:R.w,h:options.h});
|
||||
g.setClipRect(0,0,g.getWidth()-1,g.getHeight()-1);
|
||||
}
|
||||
};
|
||||
|
||||
const draw = () => {
|
||||
let dy = velocity;
|
||||
|
@ -136,14 +136,14 @@
|
|||
drag : dragHandler,
|
||||
touch : touchHandler,
|
||||
redraw : uiDraw
|
||||
}
|
||||
};
|
||||
|
||||
if (options.remove) uiOpts.remove = () => {
|
||||
if (scheduledDraw)
|
||||
clearTimeout(scheduledDraw);
|
||||
clearInterval(scheduledBrake);
|
||||
options.remove();
|
||||
}
|
||||
};
|
||||
|
||||
Bangle.setUI(uiOpts);
|
||||
|
||||
|
@ -152,6 +152,7 @@
|
|||
function idxToY(i) {
|
||||
return i*options.h + R.y - rScroll;
|
||||
}
|
||||
|
||||
function YtoIdx(y) {
|
||||
return Math.floor((y + rScroll - R.y)/options.h);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue