fix: correct rounding for exclude area slider calculation
This commit is contained in:
@@ -436,8 +436,8 @@ function Menu({data, duration, setDuration, end, setEnd, slider, setSlider, subm
|
||||
const endUnix = moment(longestSegment.end).unix();
|
||||
const endOfWindowUnix = end.unix();
|
||||
|
||||
const newSliderStart = Math.round((startUnix - endOfWindowUnix) / duration.secs + duration.num);
|
||||
const newSliderEnd = Math.round((endUnix - endOfWindowUnix) / duration.secs + duration.num);
|
||||
const newSliderStart = Math.floor((startUnix - endOfWindowUnix) / duration.secs + duration.num);
|
||||
const newSliderEnd = Math.ceil((endUnix - endOfWindowUnix) / duration.secs + duration.num);
|
||||
|
||||
const clampedStart = Math.max(0, newSliderStart);
|
||||
const clampedEnd = Math.min(duration.num, newSliderEnd);
|
||||
|
||||
Reference in New Issue
Block a user