mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 12:37:05 +03:00
Simple implementation to fix seekbar rendering on gradiant layout
Fixes #2099
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user