mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-12 06:27:14 +03:00
Fix buffering sometimes not rendering all the way
This commit is contained in:
@@ -561,8 +561,8 @@ class PreviewBar {
|
|||||||
let scalePosition = 0;
|
let scalePosition = 0;
|
||||||
let scaleWidth = 0;
|
let scaleWidth = 0;
|
||||||
|
|
||||||
for (const sectionElement of sections) {
|
for (let i = 0; i < sections.length; i++) {
|
||||||
const section = sectionElement as HTMLElement;
|
const section = sections[i] as HTMLElement;
|
||||||
const checkElement = section.querySelector(selector) as HTMLElement;
|
const checkElement = section.querySelector(selector) as HTMLElement;
|
||||||
const currentSectionWidthNoMargin = this.getPartialChapterSectionStyle(section, "width") || progressBar.clientWidth;
|
const currentSectionWidthNoMargin = this.getPartialChapterSectionStyle(section, "width") || progressBar.clientWidth;
|
||||||
const currentSectionWidth = currentSectionWidthNoMargin
|
const currentSectionWidth = currentSectionWidthNoMargin
|
||||||
@@ -579,7 +579,7 @@ class PreviewBar {
|
|||||||
const transformMatch = checkElement.style.transform.match(/scaleX\(([0-9.]+?)\)/);
|
const transformMatch = checkElement.style.transform.match(/scaleX\(([0-9.]+?)\)/);
|
||||||
if (transformMatch) {
|
if (transformMatch) {
|
||||||
const transformScale = parseFloat(transformMatch[1]);
|
const transformScale = parseFloat(transformMatch[1]);
|
||||||
if (transformScale < 1 && transformScale + checkLeft / currentSectionWidthNoMargin < 0.99999) {
|
if (i === sections.length - 1 || (transformScale < 1 && transformScale + checkLeft / currentSectionWidthNoMargin < 0.99999)) {
|
||||||
scale = transformScale;
|
scale = transformScale;
|
||||||
scaleWidth = currentSectionWidthNoMargin;
|
scaleWidth = currentSectionWidthNoMargin;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user