marginx and y in scrollbar

master
kkayam 2025-02-14 18:15:13 +00:00
parent 1af8267245
commit e74e9b61ff
1 changed files with 5 additions and 4 deletions

View File

@ -55,17 +55,18 @@
let indicatorHeight = 35; // Increased height let indicatorHeight = 35; // Increased height
// Add margins to the scrollable area // Add margins to the scrollable area
const margin = 2; // margin at top and bottom const marginY = 5; // margin at top and bottom
const scrollableHeight = overlayHeight - (margin * 2); const scrollableHeight = overlayHeight - (marginY * 2);
let indicatorY = margin + (scrollableHeight - indicatorHeight) * scrollPercent; let indicatorY = marginY + (scrollableHeight - indicatorHeight) * scrollPercent;
overlay.setBgColor(g.theme.bg).clear(); overlay.setBgColor(g.theme.bg).clear();
const marginX = 2;
// Draw rounded rectangle for scroll thumb // Draw rounded rectangle for scroll thumb
const r = 10; // corner radius const r = 10; // corner radius
const x1 = 0; const x1 = 0;
const y1 = indicatorY; const y1 = indicatorY;
const x2 = overlayWidth - margin; const x2 = overlayWidth - marginX;
const y2 = indicatorY + indicatorHeight; const y2 = indicatorY + indicatorHeight;
overlay.setColor(g.theme.fg2).fillPoly([ overlay.setColor(g.theme.fg2).fillPoly([