File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
packages/webamp/js/components Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -136,10 +136,12 @@ export default function Vis({ analyser }: Props) {
136
136
isMWOpen ,
137
137
] ) ;
138
138
139
+ // reacts to changes in doublesize mode
139
140
useEffect ( ( ) => {
140
141
if ( canvas && painter ) {
141
142
const canvasCtx = canvas . getContext ( "2d" ) ;
142
143
if ( canvasCtx ) {
144
+ painter . prepare ( ) ;
143
145
// wipes the canvas clean if playback is paused and doubled is changing
144
146
if ( audioStatus === MEDIA_STATUS . PAUSED ) {
145
147
canvasCtx . clearRect ( 0 , 0 , canvas . width , canvas . height ) ;
@@ -163,7 +165,6 @@ export default function Vis({ analyser }: Props) {
163
165
164
166
const loop = ( ) => {
165
167
canvasCtx . drawImage ( bgCanvas , 0 , 0 ) ;
166
- painter . prepare ( ) ;
167
168
painter . paintFrame ( ) ;
168
169
animationRequest = window . requestAnimationFrame ( loop ) ;
169
170
} ;
You can’t perform that action at this time.
0 commit comments