diff --git a/web/libs/editor/src/lib/AudioUltra/Common/Utils.ts b/web/libs/editor/src/lib/AudioUltra/Common/Utils.ts index cf6d7382a1fa..6a5911825298 100644 --- a/web/libs/editor/src/lib/AudioUltra/Common/Utils.ts +++ b/web/libs/editor/src/lib/AudioUltra/Common/Utils.ts @@ -214,17 +214,17 @@ export const isTimeRelativelySimilar = (a: number, b: number, observedDuration: isTimeSimilar(a / observedDuration, b / observedDuration); /** - * A constant representing the width of the browser's scrollbar in pixels. + * A constant representing the thickness of the scrollbar's handle in pixels. * This value is calculated dynamically by creating a temporary DOM element * with a scrollable area and comparing its offset width to its client width. - * Useful for making precise layout adjustments that depend on the scrollbar size. + * Useful for making precise layout adjustments that depend on the width of the scrollbar. * * Note: The calculation is performed immediately when the variable is defined * and retains its value for the duration of runtime. * * @constant {number} */ -export const BROWSER_SCROLL_SIZE = ((): number => { +export const BROWSER_SCROLLBAR_WIDTH = ((): number => { const scrollDiv = document.createElement("div"); scrollDiv.style.width = "100px"; scrollDiv.style.height = "100px"; diff --git a/web/libs/editor/src/lib/AudioUltra/Visual/Visualizer.ts b/web/libs/editor/src/lib/AudioUltra/Visual/Visualizer.ts index 4a6d0137ff40..4cdd8d180a39 100644 --- a/web/libs/editor/src/lib/AudioUltra/Visual/Visualizer.ts +++ b/web/libs/editor/src/lib/AudioUltra/Visual/Visualizer.ts @@ -1,5 +1,5 @@ import type { WaveformAudio } from "../Media/WaveformAudio"; -import { averageMinMax, BROWSER_SCROLL_SIZE, clamp, debounce, defaults, warn } from "../Common/Utils"; +import { averageMinMax, BROWSER_SCROLLBAR_WIDTH, clamp, debounce, defaults, warn } from "../Common/Utils"; import type { Waveform, WaveformOptions } from "../Waveform"; import { type CanvasCompositeOperation, Layer, type RenderingContext } from "./Layer"; import { Events } from "../Common/Events"; @@ -665,7 +665,7 @@ export class Visualizer extends Events { this.scrollFiller = document.createElement("div"); this.scrollFiller.style.position = "absolute"; this.scrollFiller.style.width = "100%"; - this.scrollFiller.style.height = `${BROWSER_SCROLL_SIZE}px`; + this.scrollFiller.style.height = `${BROWSBROWSER_SCROLLBAR_WIDTHER_SCROLL_SIZE}px`; this.scrollFiller.style.top = "100%"; this.wrapper.appendChild(this.scrollFiller); @@ -974,7 +974,7 @@ export class Visualizer extends Events { }; private setContainerHeight() { - this.container.style.height = `${this.height + BROWSER_SCROLL_SIZE}px`; + this.container.style.height = `${this.height + BROWSER_SCROLLBAR_WIDTH}px`; } private updateSize() {