Skip to content

Commit

Permalink
move processFFT() out of Painter.prepare()
Browse files Browse the repository at this point in the history
It never had a place there anyway
  • Loading branch information
0x5066 committed Jan 3, 2025
1 parent d5b5b18 commit 41810a0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/webamp/js/components/VisPainter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,6 @@ export class BarPaintHandler extends VisPaintHandler {

prepare() {
const vis = this._vis;
processFFT(
this._analyser,
this._fft,
this.inWaveData,
this.outSpectralData
);

//? paint peak
this._peak.height = 1;
Expand Down Expand Up @@ -307,6 +301,13 @@ export class BarPaintHandler extends VisPaintHandler {
maxHeight = this._vis.smallVis ? 5 : 15;
}

processFFT(
this._analyser,
this._fft,
this.inWaveData,
this.outSpectralData
);

if (this._vis.smallVis) {
if (this._vis.pixelDensity === 2) {
maxWidth = 75; // this is not 37*2, but if this was 74, we'd be missing a pixel
Expand Down

0 comments on commit 41810a0

Please sign in to comment.