From 5444f5348a9c32cd8c2d905f83cea3379232026e Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Tue, 23 May 2017 19:49:40 -0700 Subject: [PATCH] Redraw the visualizer on switching skins --- js/components/Visualizer.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/js/components/Visualizer.js b/js/components/Visualizer.js index 20cd52a1..676215ea 100644 --- a/js/components/Visualizer.js +++ b/js/components/Visualizer.js @@ -48,6 +48,8 @@ class Visualizer extends React.Component { componentDidUpdate() { this.setStyle(); + // Redraw the current frame, since the skin may have changed. + this.paintFrame(); } setStyle() { @@ -68,14 +70,6 @@ class Visualizer extends React.Component { this.bufferLength = this.props.analyser.frequencyBinCount; this.dataArray = new Uint8Array(this.bufferLength); } - // If we are paused when the skin changes, we will keep the vis colors - // until we paint again. For now we can just clear the current frame so - // we don't end up with a clashing visual. - - // TODO: Once this is split, alwasy clear on skin change - if (this.props.status === "PLAYING") { - this.clear(); - } } clear() { @@ -192,7 +186,7 @@ class Visualizer extends React.Component { return ( this.canvas = node} + ref={node => (this.canvas = node)} width="152" height="32" onClick={this.props.toggleVisualizer}