kineticscroll - Fix warnings and whitespace

pull/3296/head
Martin Boonk 2024-03-25 16:16:12 +01:00
parent ecbac6e017
commit 98325fa102
1 changed files with 21 additions and 20 deletions

View File

@ -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);
}