fixing white flash on canvas resize closes #386