Skip to content

Commit 06737dc

Browse files
authored
fix: FIT-291,FIT-306: SplitChannel audio regions not covering the whole height, Zooming out the page breaks audio rendering of the wave form (#7855)
Co-authored-by: bmartel <[email protected]>
1 parent e43cb2f commit 06737dc

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

web/libs/editor/src/lib/AudioUltra/Visual/Layer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class Layer extends Events<LayerEvents> {
7979
* Float value of the layer opacity between 0 and 1.
8080
*/
8181
private opacity = 1;
82-
private pixelRatio = 1;
82+
public pixelRatio = 1;
8383

8484
name: string;
8585

web/libs/editor/src/lib/AudioUltra/Visual/Visualizer.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ export class Visualizer extends Events<VisualizerEvents> {
212212
// as a result of multichannel or differently configured waveHeight
213213
this.setContainerHeight();
214214

215+
// Update regions layer height to match the current visualizer height
216+
const regionsLayer = this.getLayer("regions");
217+
if (regionsLayer) {
218+
regionsLayer.height = this.height;
219+
}
220+
215221
// Set renderers array
216222
this.renderers = [this.waveformRenderer];
217223
if (isFF(FF_AUDIO_SPECTROGRAMS) && this.spectrogramRenderer) {
@@ -956,18 +962,24 @@ export class Visualizer extends Events<VisualizerEvents> {
956962
// Update layer dimensions
957963
const mainLayer = this.getLayer("main");
958964
if (mainLayer) {
965+
mainLayer.pixelRatio = this.pixelRatio;
959966
mainLayer.width = this.width;
960967
mainLayer.height = this.height;
961968
}
962969

963970
// Update other layers
964971
this.layers.forEach((layer) => {
965972
if (layer.name !== "main") {
973+
layer.pixelRatio = this.pixelRatio;
966974
layer.width = this.width;
967975
// Only update height for layers that should match the waveform height
968976
if (layer.name === "waveform" || layer.name === "spectrogram" || layer.name === "spectrogram-grid") {
969977
layer.height = this.waveformHeight;
970978
}
979+
// Update regions layer height to match the full visualizer height
980+
if (layer.name === "regions") {
981+
layer.height = this.height;
982+
}
971983
}
972984
});
973985

0 commit comments

Comments
 (0)