Swap if start > end 4

This commit is contained in:
Hans5958 2022-05-06 14:36:48 +07:00
parent 08f195eb12
commit 5129fbc1ff

View file

@ -254,6 +254,7 @@ tooltip.parentElement.addEventListener('mouseenter', () => updateTooltip(parseIn
window.addEventListener('resize', () => updateTooltip(parseInt(timelineSlider.value), currentVariation))
function isOnPeriod(start, end, variation, currentPeriod, currentVariation) {
if (start > end) [start, end] = [end, start]
return currentPeriod >= start && currentPeriod <= end && variation === currentVariation
}