mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 11:37:02 +03:00
Fix progress not starting at full
This commit is contained in:
@@ -436,7 +436,7 @@ class PreviewBar {
|
|||||||
customChangedElement.style.removeProperty("display");
|
customChangedElement.style.removeProperty("display");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changedData.scale) {
|
if (changedData.scale !== null) {
|
||||||
const transformScale = (changedData.scale) / progressBar.clientWidth;
|
const transformScale = (changedData.scale) / progressBar.clientWidth;
|
||||||
|
|
||||||
customChangedElement.style.transform =
|
customChangedElement.style.transform =
|
||||||
@@ -492,14 +492,15 @@ class PreviewBar {
|
|||||||
if (transformScale < 1 && transformScale + checkLeft / currentSectionWidthNoMargin < 0.99999) {
|
if (transformScale < 1 && transformScale + checkLeft / currentSectionWidthNoMargin < 0.99999) {
|
||||||
scale = transformScale;
|
scale = transformScale;
|
||||||
scaleWidth = currentSectionWidth;
|
scaleWidth = currentSectionWidth;
|
||||||
scalePosition = currentWidth;
|
|
||||||
if (checkLeft !== 0) {
|
|
||||||
scalePosition += left;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (transformScale > 0) {
|
if (transformScale > 0) {
|
||||||
// reached the end of this section for sure, since the scale is now between 0 and 1
|
// reached the end of this section for sure, since the scale is now between 0 and 1
|
||||||
// if the scale is always zero, then it will go through all sections but still return 0
|
// if the scale is always zero, then it will go through all sections but still return 0
|
||||||
|
|
||||||
|
scalePosition = currentWidth;
|
||||||
|
if (checkLeft !== 0) {
|
||||||
|
scalePosition += left;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -510,7 +511,7 @@ class PreviewBar {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
left: left + leftPosition,
|
left: left + leftPosition,
|
||||||
scale: scale * scaleWidth + scalePosition
|
scale: scale !== null ? scale * scaleWidth + scalePosition : null
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user