fix: treat very close mouse positions to end of scrubber as the actual end of scrubber

This commit is contained in:
midzelis
2025-11-15 15:30:05 +00:00
parent e94eb5012f
commit f4af8ae5f2

View File

@@ -326,6 +326,7 @@
const lower = 0;
const upper = rect?.height - (PADDING_TOP + PADDING_BOTTOM);
hoverY = clamp(clientY - rect?.top - PADDING_TOP, lower, upper);
const hoverAtScrubberBottom = hoverY === rect?.height - (PADDING_TOP + PADDING_BOTTOM);
const x = rect!.left + rect!.width / 2;
const { segment, monthGroupPercentY, isOnPaddingTop, isOnPaddingBottom } = getActive(x, clientY);
activeSegment = segment;
@@ -334,7 +335,7 @@
const scrubData = {
scrubberMonth: segmentDate,
overallScrollPercent: toTimelineY(hoverY),
overallScrollPercent: hoverAtScrubberBottom ? 1 : toTimelineY(hoverY),
scrubberMonthScrollPercent: monthGroupPercentY,
};
if (wasDragging === false && isDragging) {