Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Commit

Permalink
Casting to int instead of using Int32.TryParse...
Browse files Browse the repository at this point in the history
  • Loading branch information
zkhcohen committed Mar 14, 2020
1 parent 87940ec commit 1d092df
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Source Files/Spectrogram-Display.cs
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,7 @@ private void onTime(object sender, ElapsedEventArgs e)

float currentCompletion = (currentPos / totalTime) * (totalLength - (_seekMin * 2));

Int32.TryParse(currentCompletion.ToString(), out int width);
Rectangle rect = new Rectangle(_seekMin, panel.Height - 10, width, 10);
Rectangle rect = new Rectangle(_seekMin, panel.Height - 10, (int)currentCompletion, 10);
myGraphics.FillRectangle(blackFill, rect);

blackFill.Dispose();
Expand Down

0 comments on commit 1d092df

Please sign in to comment.