pull in 'Ensure that changing a menu item when half-scrolled off screen doesn't overwrite widgets' from the standard scroller

master
thyttan 2023-04-05 12:38:12 +02:00
parent 9db02af9f1
commit 81bc99b7a1
3 changed files with 4 additions and 2 deletions

View File

@ -1,2 +1,4 @@
0.01: Inital release.
0.02: Rebasing on latest changes to showScroller_Q3 (https://github.com/espruino/Espruino/commit/2d3c34ef7c2b9fe2118e816aacd2e096adb99596).
0.03: Rebasing on latest changes to showScroller_Q3 (https://github.com/espruino/Espruino/commit/b6f8105b6348bb6f7cd03ac11efc1f3585c6ad79). Ensure that changing a menu item when half-scrolled off screen doesn't overwrite widgets.

View File

@ -95,7 +95,7 @@ var s = {
g.setClipRect(0,0,g.getWidth()-1,g.getHeight()-1);
}, drawItem : i => {
var y = idxToY(i);
g.reset().setClipRect(R.x,y,R.x2,y+options.h);
g.reset().setClipRect(R.x,Math.max(y,R.y),R.x2,Math.min(y+options.h,R.y2));
options.draw(i, {x:R.x,y:y,w:R.w,h:options.h});
g.setClipRect(0,0,g.getWidth()-1,g.getHeight()-1);
}};

View File

@ -1,7 +1,7 @@
{
"id": "swscroll",
"name": "Swipe menus",
"version": "0.02",
"version": "0.03",
"description": "Replace built in E.showScroller to act on swipe instead of drag. Navigate menus in discrete steps instead of a continuous motion.",
"readme": "README.md",
"icon": "app.png",