Skip to content

Commit

Permalink
Merge pull request #3336 from Sinap/develop
Browse files Browse the repository at this point in the history
Fix when console width is to small
  • Loading branch information
GrimmGringo committed Aug 8, 2016
2 parents a69f8a9 + ed5dafc commit c66eee1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions PoGo.NecroBot.CLI/Resources/ProgressBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ public static void fill(int amt, ConsoleColor barColor = ConsoleColor.Red)
{
try
{
// Window width has be be larger than what Console.CursorLeft is set to
// or System.ArgumentOutOfRangeException is thrown.
if (Console.WindowWidth < 50 + leftOffset)
{
Console.WindowWidth = 51 + leftOffset;
}

Console.ForegroundColor = barColor;
Console.CursorLeft = 0 + leftOffset;
Console.Write("[");
Expand Down

0 comments on commit c66eee1

Please sign in to comment.