Simple implementation to fix seekbar rendering on gradiant layout

Fixes #2099
This commit is contained in:
Ajay
2024-10-18 04:27:23 -04:00
parent 2691dc5df5
commit f5910407ba

View File

@@ -647,8 +647,16 @@ class PreviewBar {
if (changedData.scale !== null) {
const transformScale = (changedData.scale) / progressBar.clientWidth;
const scale = Math.max(0, Math.min(1 - calculatedLeft, (transformScale - cursor) / fullSectionWidth - calculatedLeft));
customChangedElement.style.transform =
`scaleX(${Math.max(0, Math.min(1 - calculatedLeft, (transformScale - cursor) / fullSectionWidth - calculatedLeft))}`;
`scaleX(${scale})`;
if (customChangedElement.style.backgroundSize) {
const backgroundSize = progressBar.clientWidth;
customChangedElement.style.backgroundSize = `${backgroundSize}px`;
customChangedElement.style.backgroundPosition = `${-(cursor * progressBar.clientWidth)}px`;
}
if (firstUpdate) {
customChangedElement.style.transition = "none";
setTimeout(() => customChangedElement.style.removeProperty("transition"), 50);