Skip to content

Commit bc8a453

Browse files
authored
Update LoadingAnimation.hpp
1 parent 9387dc4 commit bc8a453

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

LoadingAnimation.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
// Animation symbols and speed configuration
1212
// ----------------------------------------------------------------------------------------------
1313
// Speed of the animation in milliseconds
14-
const int ANIMATION_SPEED_MS = 200;
14+
const int ANIMATION_SPEED_MS = 100;
1515
// Symbols
16-
const char ANIMATION_SYMBOLS[] = {'|', '/', '-', '\\'}; // '-', '=', 'x', 'X', '|', 'X', 'x', '='
16+
const char ANIMATION_SYMBOLS[] = {'|', '/', '-', '\\'};
1717
// Symbol counter
1818
const int ANIMATION_SYMBOL_COUNT = sizeof(ANIMATION_SYMBOLS) / sizeof(ANIMATION_SYMBOLS[0]);
1919

@@ -31,12 +31,12 @@ class ConsoleWaitAnimation
3131
}
3232
void stop()
3333
{
34+
clearCurrentLine();
3435
isRunning = false;
3536
if (animThread.joinable())
3637
{
3738
animThread.join();
3839
}
39-
clearCurrentLine(); // Clear the line after stopping the animation
4040
}
4141
private:
4242
int currentIndex;
@@ -53,8 +53,7 @@ class ConsoleWaitAnimation
5353
}
5454
void clearCurrentLine()
5555
{
56-
std::cout << "\r" << std::string(100, ' ') << "\r"; // Attempt to clear the line
57-
std::cout << std::endl; // Move to a new line
56+
std::cout << "\r" << std::string(100, ' ') << "\r";
5857
}
5958
};
6059

0 commit comments

Comments
 (0)