mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-25 11:04:00 +00:00
Don't render visualizer background when disabled
Fixes https://github.com/captbaritone/webamp/issues/762
This commit is contained in:
parent
7eb8c18876
commit
e09a505ce5
1 changed files with 11 additions and 9 deletions
|
|
@ -176,10 +176,6 @@ class Visualizer extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
clear() {
|
||||
this.canvasCtx.drawImage(this.bgCanvas, 0, 0);
|
||||
}
|
||||
|
||||
// Pre-render the background grid
|
||||
preRenderBg() {
|
||||
this.bgCanvas = preRenderBg(
|
||||
|
|
@ -201,11 +197,17 @@ class Visualizer extends React.Component {
|
|||
}
|
||||
|
||||
paintFrame() {
|
||||
this.clear();
|
||||
if (this.props.style === VISUALIZERS.OSCILLOSCOPE) {
|
||||
this._paintOscilloscopeFrame();
|
||||
} else if (this.props.style === VISUALIZERS.BAR) {
|
||||
this._paintBarFrame();
|
||||
switch (this.props.style) {
|
||||
case VISUALIZERS.OSCILLOSCOPE:
|
||||
this.canvasCtx.drawImage(this.bgCanvas, 0, 0);
|
||||
this._paintOscilloscopeFrame();
|
||||
break;
|
||||
case VISUALIZERS.BAR:
|
||||
this.canvasCtx.drawImage(this.bgCanvas, 0, 0);
|
||||
this._paintBarFrame();
|
||||
break;
|
||||
default:
|
||||
this.canvasCtx.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue